Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
WorkbookBeforeSave Problem | Excel Discussion (Misc queries) | |||
Excel XP and WorkbookBeforeSave | Excel Programming | |||
Handling WorkbookBeforeClose and WorkbookBeforeSave | Excel Programming |