VBA Excel 2007 Private Workbook_Save Event Not Firing

I'm wanting to trap the save event in Microsoft Excel so I can display a form.

Private Sub Workbook_BeforeSave(ByVal SaveUI As Boolean, Cancel As Boolean)

    MsgBox ("Testing")
   
End Sub


I typed the above code to try and trap the save event, but it never fires.  What am i doing wrong?
davysouthernboyAsked:
Who is Participating?
 
TracyConnect With a Mentor VBA DeveloperCommented:
Did you put it in the 'ThisWorkbook' module and not a standard module (Module1) or a sheet module?

This will only fire when you click the save button.
0
 
Patrick MatthewsCommented:
Other things to check:

In your macro security, are macros enabled?

If you type ?Application.EnableEvents in the VBA Immediate window and hit Enter, do you get a response of True?
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.