Solved

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

Posted on 2010-11-09
4
4,165 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:Bryce Bassett
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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:
Bryce Bassett 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:Bryce Bassett
ID: 34179069
I found the answer on my own.  See above
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

The Selection object is designed for user interaction. It has a Range property, so it can be used in most places that a Range object can. Recorded macros must use the Selection because they are simply copying what the user is doing. A Range prope…
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…
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) …
This video walks the viewer through the process of creating Hyperlinks for the web and other documents. Select the "Insert" tab: Click "Hyperlink":  Type "http://" followed by a web address to reference a website or navigate to a document to ref…

696 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