ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is this an Excel workbook event triggered AFTER saving (https://www.excelbanter.com/excel-programming/289446-excel-workbook-event-triggered-after-saving.html)

Lee Drage[_2_]

Is this an Excel workbook event triggered AFTER saving
 
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

Rob van Gelder[_4_]

Is this an Excel workbook event triggered AFTER saving
 
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" wrote in message
...
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




Harlan Grove

Is this an Excel workbook event triggered AFTER saving
 
"Lee Drage" wrote...
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.



Lee Drage[_3_]

Is this an Excel workbook event triggered AFTER saving
 
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.


All times are GMT +1. The time now is 06:57 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com