ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is there a way to Trigger a Macro on a workbook save event (https://www.excelbanter.com/excel-programming/321119-there-way-trigger-macro-workbook-save-event.html)

Dan Gardner

Is there a way to Trigger a Macro on a workbook save event
 
I have a macro that performs a bunch of database conformity checks, i.e.
proper input format into a excel database. I was wondering if there is a way
to trigger the macro when the user tries to save the workbook, and be able to
correct any errors found before the save event takes place
Hope its possible, and thanks for any help that can be offered


Dave Peterson[_5_]

Is there a way to Trigger a Macro on a workbook save event
 
There's a workbook_beforesave event that you may want to tap into.

You could set "cancel=true" and stop the save.

Chip Pearson has a nice primer at:
http://www.cpearson.com/excel/events.htm

Dan Gardner wrote:

I have a macro that performs a bunch of database conformity checks, i.e.
proper input format into a excel database. I was wondering if there is a way
to trigger the macro when the user tries to save the workbook, and be able to
correct any errors found before the save event takes place
Hope its possible, and thanks for any help that can be offered


--

Dave Peterson


All times are GMT +1. The time now is 05:50 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com