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: 22
Default Cancel = True

First of all, thanks everyone for the invaluable help you've provided me on
this message board! ...now....

code:

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
'code to hide certain sheets
Me.Save
Cancel = True
'code to unhide certain sheets
End Sub

question: what exactly does the Cancel = True do (or not do)?
I found that when I was trying to Save As a new filename that I was not
being given the option to change the name. when I comment out the Cancel =
True line in my BeforeSave procedure I am able to do save with a new filename
when doing a Save As. I want to understand why this is so, so that I know
that I am not inadvertently causing other potential problems by removing the
Cancel = True.

TIA
Tanya (vba newbie)

 
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
why doesnt cancel=true always work? Duncan[_5_] Excel Programming 3 July 18th 06 08:48 AM
Another way to suppress print besides Cancel = True? mikeburg[_56_] Excel Programming 4 December 5th 05 02:49 PM
BeforeDoubleClick Cancel=True not working Reggie Excel Programming 1 September 20th 05 03:43 AM
Close workbook with "Cancel=TRUE" in the BeforeClose()" Wellie[_3_] Excel Programming 1 October 16th 04 09:46 PM
Setting Cancel = True in WorkbookBeforePrint Tony Excel Programming 0 December 21st 03 10:37 PM


All times are GMT +1. The time now is 03:34 PM.

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"