Solved

The macro cannot be found or has been disabled because of your Macro security settings

Posted on 2010-11-09
4
3,888 Views
Last Modified: 2012-05-10
Hi:

I have a macro-enabled Word 2007 template with a custom ribbon menu tab created using Custom UI Editor.  I get the above error message twice in a row each time I create a new document based on the template or open an existing document based on the template.

Word is installed fine and working perfectly.  My ribbon and all my VBA macros run perfectly.  It's just a nuisance.  The error occurs before it ever gets to the Document_New code.  I think it occurs when it is creating the menu tab, as if it were finding macros missing.  But  I've verified that each "onaction" macro referred to in the ribbon code exists, and has the appropriate (control as iRibbonControl) next to it.

I've had this before but can't remember how I resolved it.

Any ideas how to make this go away?

Thanks
0
Comment
Question by:versatilebb
  • 2
  • 2
4 Comments
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 34099380
I assume that this error happens even if macro security is set to super low. This usually means there are two buried in there somewhere that you missed somehow.

Check the macros manager (Alt+F8?) and make sure there aren't any that refer to another document.

Can you post the template? (Remove all proprietary/private information of course). We can help you dig.
0
 

Accepted Solution

by:
versatilebb earned 0 total points
ID: 34099761
Tommy:

Correct.  The template lives in my usual Word templates directly, which is in my trusted locations to boot, and my macro settings are at the lowest level.

I did a little more digging on my own and believe I found the solution.

I narrowed it down to this first line of my XML code for the ribbon:

<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui"  onLoad="OnLoad">

I removed  onLoad="OnLoad"  and my error messages are now gone.  I'm sure I just copied this line from another project I've done (a little knowledge is a dangerous thing).  What is that onLoad command anyway, and why would that have generated this error?

Thanks
1
 
LVL 37

Expert Comment

by:TommySzalapski
ID: 34101374
That is telling it to run the macro named "OnLoad" when the ribbon loads. So that would be the offending macro.
1
 

Author Closing Comment

by:versatilebb
ID: 34179069
I found the answer on my own.  See above
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Authors who set out to write any sort of lengthy piece for online submission—be it a long question or comment on a technical form, an article, or a substantial blog entry—often find it useful to work up a draft in an editor other t…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

803 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question