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.
Syntax
expression.RunAutoMacros(Which)
expression Required. An expression that returns a Workbook object.
Which Required. The macros to run. Can be one of the following XlRunAutoMacro constants:
Constant | Description |
---|---|
xlAutoOpen | Auto_Open macros |
xlAutoClose | Auto_Close macros |
xlAutoActivate | Auto_Activate macros |
xlAutoDeactivate | Auto_Deactivate macros |