Microsoft KB Archive/115276

From BetaArchive Wiki
Knowledge Base


Article ID: 115276

Article Last Modified on 8/15/2003



APPLIES TO

  • Microsoft Excel 95a
  • Microsoft Excel 5.0c
  • Microsoft Excel 4.0a
  • Microsoft Excel 5.0a for Macintosh
  • Microsoft Excel 4.0 for Macintosh



This article was previously published under Q115276

SYMPTOMS

In the versions of Microsoft Excel listed above, if a worksheet has both an Auto_Open and an Auto_Activate macro, both macros will run when that worksheet is opened.

NOTE: In Microsoft Excel versions 4.0 and earlier for Windows and 3.0 and earlier for Macintosh, only the Auto_Open macro will run when the worksheet is opened.

STATUS

This is a known problem in the versions of Microsoft Excel listed at the beginning of this article. This problem was corrected in Microsoft Excel 97 for Windows and Microsoft Excel 98 Macintosh Edition.

MORE INFORMATION

Example

To see an example of this problem, follow these steps:

  1. In Microsoft Excel version 4.0, create a new macro sheet.
  2. On the macro sheet, enter the following:

    A1: Macro1
    A2: =ALERT("AutoOpen")
    A3: =RETURN()
    A4:
    A5: Macro2
    A6: =ALERT("AutoActivate")
    A7: =RETURN()

  3. Select cell A1. On the Formula menu, click Define Name. Select the Command option, and click OK.
  4. Select cell A5. On the Formula menu, click Define Name. Select the Command option, and click OK.
  5. Save the macro sheet as TEST.XLM.
  6. Start a new worksheet, leaving TEST.XLM open.
  7. On the Formula menu, click Define Name. In the Name box, type AUTO_OPEN. In the Refers To box, type =TEST.XLM!MACRO1. Click OK.
  8. On the Formula menu, click Define Name. In the Name box, type AUTO_ACTIVATE. In the Refers To box, type =TEST.XLM!MACRO2. Click OK.
  9. Save the worksheet as TEST.XLS and then close both sheets.

Open TEST.XLS in Microsoft Excel version 4.0. Only the alert with the "AutoOpen" message appears.

Open TEST.XLS in Microsoft Excel version 4.0a or 5.0. An alert with the message "AutoOpen" appears followed by another with the message "AutoActivate".


Additional query words: 4.00 3.00 XL7 XL5 XL4 XL

Keywords: kbmacro kbprogramming kbprb KB115276