Solved

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

Posted on 2010-11-09
4
3,765 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
I'm writing to share my clumsy experience in using this elegant tool so you can avoid every stupid mistake I made. (I leave it to the authorities to decide if this deserves a place in the Knowledge archives.)  Now that I am on the other side of my l…
In this video, we show how to convert an image-only PDF file into a PDF Searchable Image file, that is, a file with both the image (typically from scanning) and text, which is created in an automated fashion with Optical Character Recognition (OCR) …
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.

919 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

20 Experts available now in Live!

Get 1:1 Help Now