Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Keep Before_Save from running

I have some code in Before_Close that hides and unhides some sheets.

I also have some code in Before_Save that I only want run if the workbook is
trying to be saved by the user, not if I'm the only thing being saved is the
hiding and unhiding of the sheets that's taking place in the Before_Close
macro.

So, I was hoping there's a line of code I can write in the Before_Close
macro that will keep the Before_Save macro from running? Or is it impossible
to keep the Before_Save macro from running since I'm really saving the hiding
and unhiding of sheets? I hope that makes sense. Thank you.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Keep Before_Save from running

In the Before_Close add

ThisWorkbook.Saved = True

which will fool VBA into thinking no changes have been made.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"Alex" wrote in message
...
I have some code in Before_Close that hides and unhides some sheets.

I also have some code in Before_Save that I only want run if the workbook

is
trying to be saved by the user, not if I'm the only thing being saved is

the
hiding and unhiding of the sheets that's taking place in the Before_Close
macro.

So, I was hoping there's a line of code I can write in the Before_Close
macro that will keep the Before_Save macro from running? Or is it

impossible
to keep the Before_Save macro from running since I'm really saving the

hiding
and unhiding of sheets? I hope that makes sense. Thank you.



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
running sum Pammy Excel Discussion (Misc queries) 1 October 13th 07 09:37 PM
Problem with Before_Save Macro Jay Excel Discussion (Misc queries) 5 May 18th 06 06:47 PM
Running Add-In from VBA BillCPA Excel Discussion (Misc queries) 1 April 4th 06 04:48 PM
Before_Save event quartz[_2_] Excel Programming 3 September 20th 05 12:36 AM
Need Before_Save code Phil Hageman Excel Programming 13 July 10th 03 11:55 AM


All times are GMT +1. The time now is 12:36 AM.

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"