Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default On close and before save events.

Hello

I have a workbook, when the user exits the workbook I want
it to hide (using veryhidden) all the worksheets.
When a new user opens the workbook I want to make them
select enable macros or nothing but a blank worksheet will
show.

This all I can do. The problem I face is if I add the hide
worksheets code to the before close event. If a user saves
and then tries to close the book the macro runs and then
excel asks the usual, changes have been made do u want to
save. And so the user has to save again. If I attach the
code to before save, the user may not want to close the
workbook so I don't want the macro to run.

Is there a way around this?

Austin
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default On close and before save events.

In the beforeclose event, turn off events, hide the sheets, save the
workbook, Turn events back on, continue closing. I haven't tested it
recently, but I expect that you shouldn't get prompted since you just saved
the workbook (which you need to do anyway if you want the sheets to be
hidden).

--
Regards,
Tom Ogilvy

"Austin" wrote in message
...
Hello

I have a workbook, when the user exits the workbook I want
it to hide (using veryhidden) all the worksheets.
When a new user opens the workbook I want to make them
select enable macros or nothing but a blank worksheet will
show.

This all I can do. The problem I face is if I add the hide
worksheets code to the before close event. If a user saves
and then tries to close the book the macro runs and then
excel asks the usual, changes have been made do u want to
save. And so the user has to save again. If I attach the
code to before save, the user may not want to close the
workbook so I don't want the macro to run.

Is there a way around this?

Austin



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Vba - Save but don't close Sandy Excel Worksheet Functions 4 April 4th 23 10:38 AM
save and close Mad Man Excel Discussion (Misc queries) 2 April 2nd 09 01:25 PM
Save/Close All M Scott Excel Discussion (Misc queries) 1 February 6th 07 01:12 AM
To save and close Steved Excel Worksheet Functions 5 July 27th 05 12:17 AM
Events for workbook close Aaron Queenan Excel Programming 6 July 15th 03 09:09 PM


All times are GMT +1. The time now is 04:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"