WorkbookBeforeSave

C

CinqueTerra

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!
 
B

Bob Phillips

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)
 
C

CinqueTerra

Thanks!!!

Bob Phillips said:
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top