ActiveWorkbook.Names.Add -- Problem

  • Thread starter Thread starter Ger
  • Start date Start date
G

Ger

Hi
I use the ActiveWorkbook.Names.Add to memorize the variable value (not
visible to the user) in the excel active workbook

Ex. ActiveWorkbook.Names.Add "Name", VarName, False

but with the Excel 2000 and logon to the pc with a low level user, this
property cause a popup message
"Do you want to save the changes you made to "workbook" name"? even if I
have not made any changes to the file.
Is it possible in this case to disappear this popup?

Thanks in advanced

Ger
 
Perhaps setting the saved property to True right after you add the name
(which is triggering the save prompt) you won't get the save prompt anymore
(unless something else is changed in the workbook after the property has been
set).
 
Well, you *are* making a change to the file by adding a Name.

If you don't want to save the Name, you can add the line

ActiveWorkbook.Saved = True

immediately after you add the name.
 
Thanks!!
My doubt was that if you set this "saved" property at true,
then If you made other changes in the workbook, the popup message wasn't
visualized anymore.
But this property get set if you made the changes again.

Thanks again
Bye

Ger
 
Sorry!..Another problem.. But If I made the changes in my workbook and
then I use this saved property (after the ActiveWorkbook.Names.Add...),
when the workbook is closed, it isn't saved.
How can I capture the event on the workbook changes and in this case
visualize the popup and save it?

Thank

Ger
 
One way:

With ActiveWorkbook
bOldSaved = .Saved
.Names.Add Name:="MyName", RefersTo:="MyNameReference"
.Saved = bOldSaved
End With
 
Thanks JE!! Thank you very much!!!
Thanks William too!!

Now I solved my problem :-)

Thanks and thanks again

Ger
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top