LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 312
Default After Save Event help

Hello. To ensure users have macros enabled, I have saved my file with all
sheets except a Warning sheet to xlveryhidden, with an Open Workbook event
that unhides all sheets.

I also wanted to veryhide all sheets again before save so the user can't
save the file with the sheets unhidden, and therefore allowing them to get
into the file next time with macros disabled.

This works great, except after the Before Save event fires, the Warning
sheet is displayed. So I added a button to that sheet that the user clicks
to unhide all sheets again.

Can that button be automatically pressed after the Save event takes place?
Sort of an After Save event that unhides all sheets again? I have read a
little about App.EnbleEvents, but don't know the proper syntax or use.
Thanks! My code is below:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Dim ws As Worksheet
Warning.Visible = True
For Each ws In Worksheets
If Not ws.Name = Warning.Name Then ws.Visible = xlVeryHidden
Next ws
End Sub

Sub Unhide_Sheets() 'Button to press after save
Dim ws As Worksheet
For Each ws In Worksheets
ws.Visible = True
Next ws
Warning.Visible = xlVeryHidden
End Sub


 
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
Don't save before close event? Don Wiss Excel Programming 1 September 18th 04 01:51 AM
Before Save as Event needed [email protected] Excel Programming 4 April 20th 04 07:42 PM
Worksheet Save Event ExcelMonkey[_17_] Excel Programming 3 January 24th 04 03:04 PM
save as event scrabtree23 Excel Programming 1 October 5th 03 10:14 PM
After save event Bart[_3_] Excel Programming 2 July 22nd 03 12:07 PM


All times are GMT +1. The time now is 11:26 PM.

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

About Us

"It's about Microsoft Excel"