Solved

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

Posted on 2010-11-09
4
3,665 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
Comment Utility
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
Comment Utility
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
0
 
LVL 37

Expert Comment

by:TommySzalapski
Comment Utility
That is telling it to run the macro named "OnLoad" when the ribbon loads. So that would be the offending macro.
0
 

Author Closing Comment

by:versatilebb
Comment Utility
I found the answer on my own.  See above
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
This article describes how to use the Send to Mail Recipient command. The instructions apply generally to Office 2007 and later versions, but Microsoft® Word 2013 was used for the specific steps and figures.  What is Send to Mail Recipient? Send…
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

744 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now