Initiate Macro On Save

J

JTWood

I need to initiate a macro when someone tries to "save" or "save as...
a file. Is that possible
 
G

Guest

There is a Before Save Event associted with ThisWorkbook. Right Click the
Excel Icon next to File on the menu bar and select View Code. Then paste the
following...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel As Boolean)
msgbox "you are saving..."
End Sub
 
J

JTWood

Jim said:
There is a Before Save Event associted with ThisWorkbook. Right Clic
the
Excel Icon next to File on the menu bar and select View Code. The
paste the
following...

Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, Cancel A
Boolean)
msgbox "you are saving..."
End Sub
Excellent. I will try this out today.

Thanks
 

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