ID: Q117363
The information in this article applies to:
If you run a Microsoft Visual Basic for Applications procedure that inserts a macro as a text file into a module, and then runs the macro in that module, you receive the following error message:
Run-time error '1004':
Cannot find macro 'MacroName'
This error message occurs if either of the following conditions is true:
-or-
Note that because of this behavior, it is possible to run a procedure that inserts two macros with the same name into the same module, and then runs the macro inserted first, because the second macro is not recognized until the procedure that inserts the two macros is finished.
The error occurs in the second case because the macro is inserted above the Option Explicit statement. The Option Explicit statement must appear at the beginning of a module.
To avoid this error message when you run a Visual Basic procedure to insert an entire macro into a new module, and then run the macro, follow these steps:
-and-
-or-
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
Additional query words: 5.00 5.00a 5.00c 7.00 err msg
Keywords : kberrmsg kbdta KbVBA
Version : WINDOWS:5.0,5.0c,7.0,7.0a,97; MACINTOSH:5.0,5.0a
Platform : MACINTOSH WINDOWS
Issue type : kbbug
Solution Type : kbpending
Last Reviewed: December 8, 1998