How can I call a macro from an unviewable project

D

Dan Neely

I have a macro in a template that I can manually run using the Tools-
Macros menu option. In the VBA editor though when I try and expand
the document it's from in the project pane I get a messagebox titled
"Project Locked" with a message of "Project is unavailable". I tried
manually writing the code to run it, but get an error 424.

ProjectName.ThisDocument.MacroName
 
J

Jonathan West

Dan Neely said:
I have a macro in a template that I can manually run using the Tools-
Macros menu option. In the VBA editor though when I try and expand
the document it's from in the project pane I get a messagebox titled
"Project Locked" with a message of "Project is unavailable". I tried
manually writing the code to run it, but get an error 424.

ProjectName.ThisDocument.MacroName

Use the Application.Run method. Provided that you know the name of the
routine, and the routine is Public, you can run it.
 
D

Dan Neely

Use the Application.Run method. Provided that you know the name of the
routine, and the routine is Public, you can run it.

Ok. I know the document name. I know the macroname and can run it
from the Tool-Macros dialog (I assume this means it's public). How
can I find out what module it's contained in? Is there a way to do it
through word, or do I need to the vendor that provided it in the first
place?
 
D

Dan Neely

Ok. I know the document name. I know the macroname and can run it
from the Tool-Macros dialog (I assume this means it's public). How
can I find out what module it's contained in? Is there a way to do it
through word, or do I need to the vendor that provided it in the first
place?

I managed to guess the module name, but am still interested in knowing
if there's a more foolproof approach.
 
J

Jonathan West

Dan Neely said:
Ok. I know the document name. I know the macroname and can run it
from the Tool-Macros dialog (I assume this means it's public).
Correct.

How
can I find out what module it's contained in? Is there a way to do it
through word, or do I need to the vendor that provided it in the first
place?

Provided the macro name is unique, you don't need the module name. If the
macro name is not unique, it is qualified by the module name (and if
necessary, the project name & template name) when displayed within the Tools
Macro dialog.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top