ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Auto-execute macro.... (https://www.excelbanter.com/excel-discussion-misc-queries/42124-auto-execute-macro.html)

Eric @ SEASH, Evansville

Auto-execute macro....
 
How can you get a macro to automatically execute as the file is being closed,
but before the file is saved ?

William Horton

You could put your code in the BeforeClose event of the ThisWorkbook sheet
module. You can then add to your code to see if the file has been saved or
not. You can check the files Saved property.

Bill Horton

"Eric @ SEASH, Evansville" wrote:

How can you get a macro to automatically execute as the file is being closed,
but before the file is saved ?



All times are GMT +1. The time now is 03:43 AM.

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