Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
before save event
?Hi,
I have some code in the before save event. Its very simple, it only hides the worksheets prior to a save. Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean) Dim wSheet As Variant Worksheets("menu").Activate 'hide other ThisWorkbook.worksheets For Each wSheet In ThisWorkbook.Worksheets If (wSheet.Name < "BLANK") Then wSheet.Visible = xlSheetVeryHidden Next wSheet End Sub This code works perfectly every time if I run it from a save from the toolbar or if I close the workbook down. What it doesnt do, is where my problem lays. If I call thisworkbook.save from VBA, the event fires and it runs through the code, but it doesnt action anything. The sheets dont hide, even though the code is running. Can any one help? Regards Anthony |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Save Copies of Workbook with Before Save Event | Excel Programming | |||
Save As Event | Excel Programming | |||
Example After Save Event | Excel Programming | |||
After Save Event help | Excel Programming | |||
After save event | Excel Programming |