Thanks for your patience.
Here's what I'm trying to do:
When the workbook opens, I want sheet1 to be visible and sheet4 to be
hidden. When the macros are enabled, I can use a workbook_open event.
The problem is when the macros are disabled. When the macros are
disabled, I want sheet1 to be visible because it is an information
sheet telling the users that the macros are disabled and to lock all
the other sheets so that no changes can be made to them (many
calculations on the sheets are done with macros). I also want sheet4 to
be hidden. I know there's a warning about macros being disabled when the
workbook opens, but many of the end users do not take the time to read
through and understand that the workbook will not function correctly.
Therefore, I could use some kind of workbook_beforeclose event, but I
would have to save the changes. What if the user does not want to save
changes on close?
So, I figure if I could use a beforesave event, then I could make
sheet1 visible and sheet4 hidden so that when another user opens the
workbook with macros disabled, the first thing they see is the
information sheet. But, if the user was doing something else on another
sheet at the time of save, then
they would have to go back and unhide sheet4. It would be a hassle for
the end user.
What I'm trying to do with workbook_beforesave is:
-save the current sheet name
-unhide sheet1
-hide sheet4
-save the workbook
After save (Return to the sheet the user was working on):
-return to the sheet the user was working on
-hide sheet1
-unhide sheet4
I'm hiding sheet4 because it's run entirely on macros. It manages all
the sheets. The user can set up new spreadsheets through different
templates and delete, print, export, or e-mail existing sheets. If
macros are disabled, then this sheet is useless and ultimately confuses
the end users.