Workbook.RunAutoMacros Method (Excel)
Runs the Auto_Open, Auto_Close, Auto_Activate, or Auto_Deactivate macro attached to the workbook. This method is included for backward compatibility. For new Visual Basic code, you should use the Open, Close, Activate and Deactivate events instead of these macros.
expression A variable that represents a Workbook object.
Specifies the automatic macro to run.
This example opens the workbook Analysis.xls and then runs its Auto_Open macro.
This example runs the Auto_Close macro for the active workbook and then closes the workbook.