ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Save problem (https://www.excelbanter.com/excel-programming/307758-save-problem.html)

MikeR[_2_]

Save problem
 
I have a macro that hides sheets (bar one) saves the result then
returns the sheets to view.... the user sees only a blib and is
returned to the same point prior to save. The problem is if the user
uses Ctrl. "S" or Excels save...
I can use the "before-save" in workbooks but can't figure out how
after save is automatically triggered how to return to the same sheet.
The best I can accomplish is to have a button on the Sheet left
visible after save that drives the sheets back open and back to the
sheet prior to save.
The solution may be simple but... "can't see the wood for the trees
??!!"
Any help appreciated

Tom Ogilvy

Save problem
 
If you need to do an after_save action, then in the before save event, set
cancel = true to cancel the user initiated save, disable events so you don't
trigger another before_save event, perform you actions, save the file,
enable events, activate your page.

--
Regards,
Tom Ogilvy

"MikeR" wrote in message
m...
I have a macro that hides sheets (bar one) saves the result then
returns the sheets to view.... the user sees only a blib and is
returned to the same point prior to save. The problem is if the user
uses Ctrl. "S" or Excels save...
I can use the "before-save" in workbooks but can't figure out how
after save is automatically triggered how to return to the same sheet.
The best I can accomplish is to have a button on the Sheet left
visible after save that drives the sheets back open and back to the
sheet prior to save.
The solution may be simple but... "can't see the wood for the trees
??!!"
Any help appreciated




MikeR[_2_]

Save problem
 
"Tom Ogilvy" wrote in message ...
If you need to do an after_save action, then in the before save event, set
cancel = true to cancel the user initiated save, disable events so you don't
trigger another before_save event, perform you actions, save the file,
enable events, activate your page.

--
Regards,
Tom Ogilvy


Thanks Tom... had the enabled events in the back of my mind the
"cancel = true" was the missing bit


All times are GMT +1. The time now is 10:15 AM.

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