Microsoft KB Archive/36912

From BetaArchive Wiki

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:

  1. Open the worksheet and the macro sheet that you want to have opened automatically.

  2. From the Window menu, select the name of the worksheet to ensure that it is the front window.

  3. From the Formula menu, select Define name.

  4. In the Name box, type “auto_open” (without quotes).

  5. 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

  6. Click OK.

  7. 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.