Microsoft KB Archive/36912

Defining “auto_open” Name on Worksheet PSS ID Number: Q36912 Article last modified on 02-26-1993 PSS database name: W_eXceL

2.x 3.00

WINDOWS

Summary:

When using Excel, you can open a macro sheet and run a macro whenever a worksheet is opened by doing the following:

  Open the worksheet and the macro sheet that you want to have opened automatically.   From the Window menu, select the name of the worksheet to ensure that it is the front window.   From the Formula menu, select Define name.   In the Name box, type “auto_open” (without quotes).   In the Refers to box, type a reference to the macrosheet and the macro you want to have automatically run each time the worksheet is opened. The following is an example: =MACRO1.XLM!theMacro   Click OK.   Save the worksheet. 

More Information:

It is important that the macro sheet is open during this process, or the auto_open name will not be defined properly. If the name “auto_open” is defined on the worksheet and the corresponding macro sheet is not being opened when the worksheet is opened, make sure that the reference to the macro sheet is a correct reference.

One way to determine if Excel is recognizing the macro’s reference is to check if the document name is in uppercase characters. For example, in the reference “=macro1.xlm!theMacro”, Excel does not recognize the reference. In the reference “=MACRO1.XLM!theMacro”, Excel does recognize the reference. If Excel is not recognizing the auto_open reference, redefine the name “auto_open” with the steps above.

Additional reference words: 2.0 2.00 2.01 2.1 2.10 3.0 3.00

Copyright Microsoft Corporation 1993.