Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default WorkbookBeforeSave different actions on exit

I have an overloaded WorkbookBeforeSave method. When I exit this
procedure I would expect it to run the standard saving functionality.
( Unless I set the Cancel or SaveAs booleans) However it seems to
have different results based on if anything is done in the function or
not.

Application.DisplayAlerts = False
ActiveWorkbook.SaveAs FileName:=InstallDir & "NewFile.xls"
Application.DisplayAlerts = True

If the function isDeveloper returns false the below overloaded
procedure does not save the file on its exit

Private Sub App_WorkbookBeforeSave(ByVal WB As Workbook, ByVal
SaveAsUI As Boolean, Cancel As Boolean)

If Not isDeveloper Then Exit Sub

....

End sub

However if I create temp variable the excel will now save the file
successfully

Private Sub App_WorkbookBeforeSave(ByVal WB As Workbook, ByVal
SaveAsUI As Boolean, Cancel As Boolean)

Dim tempvar As Integer
tempvar = 1

If Not isDeveloper Then Exit Sub

....

End sub

Is there some rational for why this happens? Are there any caveat's
for event overloading that I am missing out on?

Thanks
Tom

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
WorkbookBeforeSave Problem Steve Excel Discussion (Misc queries) 2 November 1st 09 10:01 AM
workbookbeforesave [email protected] Excel Programming 4 August 9th 07 03:52 PM
Actions between user actions Indiana Epilepsy and Child Neurology[_2_] Excel Programming 5 August 23rd 06 09:22 PM
WorkbookBeforeSave CinqueTerra Excel Programming 2 January 12th 06 12:21 AM
Excel XP and WorkbookBeforeSave Dave McL. Excel Programming 2 December 5th 05 05:08 AM


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