XL: Error Calling Macro Contained in Open Add-InLast reviewed: September 2, 1997Article ID: Q115208 |
The information in this article applies to:
SYMPTOMSWhen you call a macro that is contained in an add-in file, either by using the Call statement or by using the macro name in a Visual Basic procedure in Microsoft Excel, you receive one of the following error messages, even if the add-in that contains the macro is open at the time:
Sub or Function not defined -or- Compile error: Sub or Function not defined CAUSEThis behavior occurs when the add-in that contains the macro that you are calling is not selected in the References dialog box. When you open an add- in file, the add-in is added to the References dialog box, but is not selected. This is by design of Microsoft Excel.
WORKAROUNDSTo avoid receiving an error message when you call a macro that is contained in an add-in file from a Visual Basic procedure, do either of the following:
MORE INFORMATIONWhen you use the References dialog box to directly reference another workbook, add-in, or object library file, you can run a macro contained in the referenced file using the Call statement and the macro name, or only the macro name. For more information about running a macro that is contained in an add-in, query on the following words in the Microsoft Knowledge Base:
tools and references and addin and run REFERENCESFor a definition of a Referenced Project, click the Search button in Help and type:
referenced project |
Additional query words: XL97 97 7.00 5.00 err msg
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |