Is this an Excel workbook event triggered AFTER saving

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I need to get the new name of a workbook immediately after the workbook is saved. Is there an event that is triggered AFTER a save is performed i.e. I need an event like Workbook_AfterSave. I guess I can set a flag in the Workbook_BeforeSave event and then whenever the workbook/worksheet/ etc is clicked check this flag is if set record the workbook name. Any better ideas?


Thanks

Lee
 
Lee,

You could use the BeforeSave event and handle the whole saving process in
your code. Then you'll know the name of the file by the end of the
procedure.

Rob


Lee Drage said:
I need to get the new name of a workbook immediately after the workbook is
saved. Is there an event that is triggered AFTER a save is performed i.e. I
need an event like Workbook_AfterSave. I guess I can set a flag in the
Workbook_BeforeSave event and then whenever the workbook/worksheet/ etc is
clicked check this flag is if set record the workbook name. Any better
ideas?
 
Lee Drage said:
I need to get the new name of a workbook immediately after the workbook
is saved. . . .

Why do you believe you need this? The workbook's Name and FullName
properties are set after the Excel finishes saving the workbook, so any
other macro could access those properties.
 
HI Thanks for the reponses.

Thanks, Rob - I had the same idea about handling all the saving myself in the BeforeSave event last night on the train!

Harlan - I store the excel workbook name because I need to refer to worksheets and custom toolbars in this workbook even when the user has moved into another workbook. I prefer not to use a variable pointing to the required worksheet because any untrapped error will result in that variable being reset to NULL, so I save the workbook name in a windows INI file. When the user changes the workbook name by SavingAs, I update the INI file. I know the workbook name is changed by Excel straight after the save but I need to a trigger to save this new workbook name to the INI file.
 
Back
Top