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

Microsoft gives this example for the BeforeSave Event:

Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, _
ByVal SaveAsUI As Boolean, Cancel As Boolean)
a = MsgBox("Do you really want to save the workbook?", vbYesNo)
If a = vbNo Then Cancel = True
End Sub

I copied this into the Module 2. No Message Box appears when I save. What
am I doing wrong?

Thanks in advance!
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default WorkbookBeforeSave

It doesn't go in a standard code module, it should be added to the
ThisWorkbook module.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"CinqueTerra" wrote in message
...
Microsoft gives this example for the BeforeSave Event:

Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, _
ByVal SaveAsUI As Boolean, Cancel As Boolean)
a = MsgBox("Do you really want to save the workbook?", vbYesNo)
If a = vbNo Then Cancel = True
End Sub

I copied this into the Module 2. No Message Box appears when I save.

What
am I doing wrong?

Thanks in advance!



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 24
Default WorkbookBeforeSave

Thanks!!!

"Bob Phillips" wrote:

It doesn't go in a standard code module, it should be added to the
ThisWorkbook module.

--

HTH

RP
(remove nothere from the email address if mailing direct)


"CinqueTerra" wrote in message
...
Microsoft gives this example for the BeforeSave Event:

Private Sub App_WorkbookBeforeSave(ByVal Wb As Workbook, _
ByVal SaveAsUI As Boolean, Cancel As Boolean)
a = MsgBox("Do you really want to save the workbook?", vbYesNo)
If a = vbNo Then Cancel = True
End Sub

I copied this into the Module 2. No Message Box appears when I save.

What
am I doing wrong?

Thanks in advance!




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
Excel XP and WorkbookBeforeSave Dave McL. Excel Programming 2 December 5th 05 05:08 AM
Handling WorkbookBeforeClose and WorkbookBeforeSave Tom Ogilvy Excel Programming 0 September 19th 03 06:27 PM


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