XL: "Cannot Open Add-In" Error When You Run a Macro

Last reviewed: March 13, 1998
Article ID: Q162407
The information in this article applies to:
  • Microsoft Excel for Windows 95, version 7.0
  • Microsoft Excel 97 for Windows

SYMPTOMS

When you run a Visual Basic for Applications macro in Microsoft Excel 7.0 or Microsoft Excel 97, you may receive one of the following error messages:

   Run-time error '1004':
   Cannot open Microsoft Excel Add-In for editing. Please edit the source
   document instead.

   -or-

   Run-time error '1004':
   Cannot open Microsoft Excel 97 Add-In for editing. Please edit the
   source document instead.

CAUSE

This problem occurs if the following conditions are true:

  • The macro you are running opens a Microsoft Excel add-in file (a .xla file).

    -and-

  • You run the macro using a shortcut key that includes the SHIFT key. For example, you press the following keystroke:

          CTRL+SHIFT+T
    

WORKAROUND

To work around this problem, do not assign a shortcut key that includes the SHIFT key to any macro that opens any type of file.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

When you create a Visual Basic macro in Microsoft Excel, you can assign a shortcut key to the macro. When you press the shortcut key, Microsoft Excel runs the macro to which you assigned the shortcut key. To assign a shortcut key to a macro, use the following appropriate steps.

Microsoft Excel 97

  1. On the Tools menu, point to Macro, and click Macros.

  2. In the list of macros, click the macro to which you want to assign a shortcut key. Then, click Options.

  3. Type a single letter in the shortcut key box.

  4. Click OK. Then, click Cancel.

NOTE: If you hold down the SHIFT key while you type a letter in the shortcut key box, the label to the left of the box changes from "Ctrl+" to "Ctrl+Shift+." When you do this, you must include the SHIFT key to use the shortcut key to run the macro.

Microsoft Excel 7.0

  1. On the Tools menu, click Macro.

  2. In the list of macros, click the macro to which you want to assign a shortcut key. Then, click Options.

  3. Select (check) the Shortcut Key check box. Then, type a single letter in the shortcut key box.

  4. Click OK. Then, click Close.

If the shortcut key for a macro includes the SHIFT key, the macro may not work as expected if it opens any files, particularly a Microsoft Excel add-in file. This occurs because holding down the SHIFT key while a file is opening causes Microsoft Excel to open the file in edit mode, and you cannot open an add-in in this mode. For this reason, Microsoft recommends that you do not assign a shortcut key that includes the SHIFT key to a macro that opens files.


Additional query words: 7.00 XL97 XL7
Keywords : kberrmsg xlvbainfo
Version : WINDOWS:7.0,97
Platform : WINDOWS


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 13, 1998
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.