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

ID: Q162407

The information in this article applies to:

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:

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.

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 kbdta xlvbainfo KbVBA 
Version           : WINDOWS:7.0
Platform          : WINDOWS

Last Reviewed: May 27, 1999