WD2000: Run Time Error 4366 Using Application.Run CommandID: Q198840
|
When you run a Visual Basic For Applications macro containing the
"Application.Run Macroname:=" command in Microsoft Word or in another
Office program to automate Word, the following error
message may appear:
Run Time error '4366' : Unable to run the specified macro.
You have included a template name as part of the Macroname argument string.
To avoid naming conflicts among referenced projects, give your procedures unique names, so that you can call a procedure without specifying a project or module.
Remove the template name from the Macroname argument.
Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article.
Microsoft provides programming examples for illustration only, without
warranty either expressed or implied, including, but not limited to, the
implied warranties of merchantability and/or fitness for a particular
purpose. This article assumes that you are familiar with the programming
language being demonstrated and the tools used to create and debug
procedures. Microsoft support professionals can help explain the functionality
of a particular procedure, but they will not modify these examples to
provide added functionality or construct procedures to meet your specific
needs. If you have limited programming experience, you may want to contact
the Microsoft fee-based consulting line at (800) 936-5200. For more
information about the support options available from Microsoft, please see
the following page on the World Wide Web:
http://www.microsoft.com/support/supportnet/refguide/
Application.Run "Normal.Module1.MAIN"
Application.Run "MyProject.MyModule.MyProcedure"
Application.Run "'My Document.doc'!ThisModule.ThisProcedure"
project.module.procedure.
Normal | all modules stored in the Normal.dot |
TemplateProject | all modules stored in the first file in the Startup folder (if more than one template is in the Startup folder, Word uses the one that was copied to the folder first and not the alphabetical listing order) |
Project | additional startup templates, the template the open file is based on, or an open saved document with a module. |
Normal.NewMacros.Mymacro
Project.NewMacros.Mymacro
Project1.NewMacros.Mymacro
TemplateProject.NewMacros.Mymacro
Application.Run "TemplateProject.NewMacro.macro1"
Normal.NewMacros.Mymacro = Normal.dot
Project.NewMacros.Mymacro = MyTemp.dot
Project1.NewMacros.Mymacro = MyDoc.doc
Additional query words: vb
Keywords : kbdta OffVBA kbmacroexample kbwordvba wd2000
Version : WINDOWS:2000
Platform : WINDOWS
Issue type : kbbug
Last Reviewed: May 13, 1999