XL: Macro On Workbook Is Not Defined Error While Updating Links

ID: Q117231

The information in this article applies to:

SYMPTOMS

When you open a Microsoft Excel workbook that contains an external link, and then re-establish links in the workbook, you may receive the following error message:

   <Macro name> on <Workbook name> is not defined or is too complex

where <Macro name> is the name of a macro in an external workbook called <Workbook name>.

CAUSE

Case 1: The Object Is Assigned to a Macro

This problem occurs when you open a workbook that contains an object that is linked to a macro in another workbook, and you re-establish the links in the workbook.

When you assign a macro to an object, and the macro is in a different workbook, a link to the workbook that contains the macro appears in the Links dialog box. If you update this link by clicking Update Now in the Links dialog box, and the workbook that contains the macro is closed, the error message appears because Microsoft Excel cannot update the link.

This behavior is by design of Microsoft Excel.

Note that this problem also occurs if you re-establish links in a workbook that contains an object that is linked to a macro in another workbook, and the workbook you open also contains a reference to a named range in the workbook.

When you open this type of workbook, Microsoft Excel prompts you to re- establish links in the workbook.

NOTE: When you open a workbook that contains an object that is linked to a macro in another workbook, and the workbook you open does not contain any other external links, Microsoft Excel should not prompt you to re-establish the links when you open the workbook. Microsoft Excel prompts you to update links if the "Ask to Update Automatic Links" check box is selected on the Edit tab in the Options dialog box.

The message to re-establish links does not appear when either of the following conditions are true:

Case 2: Calling a Custom Function in an Add-In

This problem occurs when you open a workbook that contains a formula that calls a custom function in an add-in, and then re-establish the links in the workbook. This problem occurs when all of the following conditions are true:

WORKAROUNDS

Method 1: The Object Is Assigned to a Macro

To work around the problem when the object is assigned to a macro, do any of the following:

Method 2: Calling a Custom Function in an Add-In

To work around this problem when you open a workbook that calls a custom function in an add-in, do the following:

1. Quit Microsoft Excel.

2. Start Microsoft Excel, and then open the workbook that contains the

   link.

3. When you are prompted to re-establish links, click No.

   NOTE: Any formulas that call custom functions in a moved add-in display
   the full path to the previous location of the add-in.

4. On the Tools menu, click Add-Ins.

5. In the Add-Ins dialog box, click Browse. In the Browse dialog box,

   locate and select the add-in that you moved.

6. Click OK.

7. In the Add-Ins dialog box, make sure the add-in is selected and click

   OK.

   Formulas no longer display the incorrect path to the moved add-in;
   because the add-in is in random access memory (RAM), the formulas
   contain only the call to the custom function.

8. Save the workbook.

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.

REFERENCES

Microsoft Excel 97

For more information about assigning a macro to a graphic object or to a button on a sheet, click the Index tab in Microsoft Excel Help, type the following text

   macros, running

and then double-click the selected text to go to the "Run a macro from a button or graphic control" topic.

Microsoft Excel 5.0

For more information about assigning a macro to a graphic object or to a button on a sheet, click the Search button in Help and type:

   assigning macros

Additional query words: 7.00 5.00 err msg
Keywords          : kberrmsg kbprg xlvbainfo PgmOthr 
Version           : WINDOWS: 5.0,5.0c,7.0,7.0a; MACINTOSH: 5.0,5.0a
Platform          : MACINTOSH WINDOWS
Issue type        : kbbug

Last Reviewed: December 2, 1997