Auto_Close, Auto_Open Macros Not Executed in ExcelLast reviewed: August 20, 1995Article ID: Q46350 |
The information in this article applies to:
SUMMARYAn Auto_Open macro is a macro that is defined to automatically run when the sheet is opened. An Auto_Close macro is a macro that is defined to automatically run when the sheet is closed. These procedures work correctly when you open or close the sheet manually. However, if the sheet is opened or closed by another macro, the automatic macros will not be executed. This behavior is by design. This is also true for Solver, Q+E, and all add-in macros included in the Microsoft Excel LIBRARY subdirectory. Because the Auto_Open macro does not run when you open these files from another macro sheet, you will be unable to execute any of the menu commands that these add-in macros supply.
WorkaroundYou can cause the Auto_Open macro to run by simply placing a RUN statement in the calling macro that then runs the Auto_Open macro. An example using the add-in FLATFILE.XLA macro is shown below:
A2:=OPEN("Flatfile.xla") A3:=RUN(Flatfile.xla!Auto_Open)After executing the RUN statement, you are then able to run any menu commands that FLATFILE.XLA normally supplies.
REFERENCES"Microsoft Excel User's Guide," version 3.0, page 676
|
KBCategory: kbusage
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |