Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
Jay
 
Posts: n/a
Default Problem with Before_Save Macro

Hello All,
I am having a problem with the before_save macro:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
For Each sh In Sheets
sh.Visible = xlSheetVeryHidden
Worksheets("Overview").Visible = True
Next sh
Next
End Sub

It does nothing when I save. The macro doesn't seem to run at all. If
anyone could help me on this, I would appreciate it.
Jason

  #2   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Problem with Before_Save Macro

Firtsly, it needs to be in ThisWorkbook code module.

Also, it is broken

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
Worksheets("Overview").Visible = xlSheetVisible
For Each sh In ThisWorkbook.Sheets
sh.Visible = xlSheetVeryHidden
Next sh
End Sub

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Jay" wrote in message
oups.com...
Hello All,
I am having a problem with the before_save macro:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As
Boolean)
For Each sh In Sheets
sh.Visible = xlSheetVeryHidden
Worksheets("Overview").Visible = True
Next sh
Next
End Sub

It does nothing when I save. The macro doesn't seem to run at all. If
anyone could help me on this, I would appreciate it.
Jason



  #3   Report Post  
Posted to microsoft.public.excel.misc
Jay
 
Posts: n/a
Default Problem with Before_Save Macro

Bob,
I do have it in ThisWorkbook, and I attempted to fix it, and it still
doesn't work.
Jay

  #4   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default Problem with Before_Save Macro

In the immediate window in the VBIDE type

Application.EnableEvents = True

and return.

--
HTH

Bob Phillips

(remove xxx from email address if mailing direct)

"Jay" wrote in message
oups.com...
Bob,
I do have it in ThisWorkbook, and I attempted to fix it, and it still
doesn't work.
Jay



  #5   Report Post  
Posted to microsoft.public.excel.misc
Jay
 
Posts: n/a
Default Problem with Before_Save Macro

Hey Bob,
Sorry for the late response, thank you, it worked.
Jason



  #6   Report Post  
Posted to microsoft.public.excel.misc
Jay
 
Posts: n/a
Default Problem with Before_Save Macro

Hey Bob,
Sorry for the late response, thank you, it worked.
Jason

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
Problem in macro Micos3 Excel Discussion (Misc queries) 2 February 23rd 06 02:20 PM
Macro Help In Excel welshlad Excel Discussion (Misc queries) 14 October 26th 05 02:34 PM
deleting a macro resulted in a problem militant Excel Discussion (Misc queries) 0 April 26th 05 05:21 AM
External data Macro Problem Excel 97 Craig Kelly Excel Discussion (Misc queries) 1 January 17th 05 03:17 PM
Problem executing a macro from different workbook where it is Sergio Calleja Excel Discussion (Misc queries) 1 January 17th 05 12:38 PM


All times are GMT +1. The time now is 02:38 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"