macro cannot be found or has been disabled

J

Jnet

I have Microsoft Office Word 2003, windows XP. I continually get the error
message: "macro cannot be found or has been disabled" for macros that used to
work. My macro security level is set to medium and "trust all installed
add-ins and templates" is selected. I also have "all active templates and
documents" selected. When I run the macro from tools>macro.macros, visual
basic opens with the error message "compile error: ambiguous name detected:
MAIN." Ideas anyone?
 
J

Jean-Guy Marcil

Jnet said:
I have Microsoft Office Word 2003, windows XP. I continually get the error
message: "macro cannot be found or has been disabled" for macros that used to
work. My macro security level is set to medium and "trust all installed
add-ins and templates" is selected. I also have "all active templates and
documents" selected. When I run the macro from tools>macro.macros, visual
basic opens with the error message "compile error: ambiguous name detected:
MAIN." Ideas anyone?

"ambiguous name detected" usually means that you have duplicate sub names or
are using sub names that are identical to VBA key words.
In this case, I would check all subs and make sure that i do not have two
MAIN sub within the same module, or two modules witht he same name and both
containing a MAIN sub. If the latter applies, it means you are not naming
your projects, which would be a good idea...
 
J

Jnet

--
Jnet


Jean-Guy Marcil said:
"ambiguous name detected" usually means that you have duplicate sub names or
are using sub names that are identical to VBA key words.
In this case, I would check all subs and make sure that i do not have two
MAIN sub within the same module, or two modules witht he same name and both
containing a MAIN sub. If the latter applies, it means you are not naming
your projects, which would be a good idea...
Since I know less than nothing about visual basic, any ideas on where to
learn the basics of sub names, VBA keywords and modules?
 
J

Jnet

Thanks Jean-Guy Marcil. I did find two MAIN sub within the same module.
Problem solved!
 

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

Top