Known And Previously Used Macro Won't Run

macro wont run

Applies To: Office | Office 2007 | Microsoft Office Word | Windows 7

I use a macro for a particular mail-merge operation, and have used it quite successfully on many occasions in the past.

 

I have tried to run it over the last few days, but I keep getting a message saying it cannot be loaded due to my macro security settings.

 

My security settings are correctly set; I have ensured that the macro is the latest version, and I am told (via developer ribbon) that the macro is loaded.

 

Can anyone make any suggestions that I might try please.

 

Thank you,

 

Ian

February 17th, 2012 3:29pm

Now, before I go on keep in mind that my experiences are with Word 2010, not so much 2007. However, because I already read that there are several similiarities when it comes to Macro protection I felt I should respond anyway...

By default Macro execution is turned off in Word. In Word 2010 you can apply "trusted locations" from which Macro's will always be run, as far as I know in 2007 you can only enable or disable execution on a per-file basis.

As such; you say the seucrity settings are correct, but which setting did you use exactly ?

For the record: I'm talking about the settings in the security centre, so just in case:

  • Press the Office button and select 'Word Options'
  • Select 'Trust centre' and then 'Trust centre settings'

AFAIK you need both "Enable all macro's" enabled as well as "Trust access to the VBA project object model"

Hope this can help a bit.

Free Windows Admin Tool Kit Click here and download it now
February 19th, 2012 5:53pm

Hi Peter

Many thanks for your response.

I have tried it with both Enable All and VBA trusted, but to no avail.

I have today completly uninstalled and re-installed Office 2007, and I have tried the latest and older versions of the macro, but still no luck.

I even un-installed the latest MS Office Updates, as they installed after the last successful use of the macro, but still NO.

I am at my wits end, and even contacted the chap who wrote the macro, but he proved a tad unhelpful and dismissed it by saying he didn't know why I was getting the problem.

Strange, because I did quite a lot of unpaid worjk in helping him to debug the macro in the first place. (As a user and not a programmer I hasten to add.)

If you have any more ideas, I should welcome them.

Many thanks,

Ian

February 20th, 2012 1:19am

This is a wild guess on my part but perhaps its usefull. Still, I have to stress this out: I'm guessing here, so don't get your hopes up, however; my guess is an educated one (I'm not speculating out of the blue).

I looked this up and it seems this also applies to 2007: trusted locations. So basically; this is a place on your HD which is 'trusted' by Office (Word). As such Word won't impose any restrictions on the document where macro and vba usage is concerned. I know this to be true for 2010 (which I use) but I don't know all the details for 2007. Still; from what I've read this should also apply to 2007.

From your Trust centre (which I mentioned above) you should also have the option "Add trusted location". If you're 100% sure that the document you're trying to use sits in a safe place (meaning: you trust this document but also the other documents in that same folder) then you should try to add the folder to Word's trusted locations.

That should make sure that Word doesn't block scripts and macro's "just because".

Hope this can help too.

Free Windows Admin Tool Kit Click here and download it now
March 3rd, 2012 10:22pm

Hi Shell.user

Thank you for your input, but I have already ensured that the "trusted location" encompasses that in which the macro lives.

I have, since posting, tried running earlier versions of the macro and have found one which works.

I am concluding that the macro has a "bug" in it, despite the fact it is the currently available download from their website.

Kind regards,

Ian

March 4th, 2012 1:58am

Hi Ian,

Yes, if you went trough all this already then it does seem the most logical cause of your problems.

Hope you manage to get this sorted out though!

Free Windows Admin Tool Kit Click here and download it now
March 4th, 2012 12:14pm

I had the same problem Ian, I'm not a Microsoft engineer (just a user) and I am using Word 2013 so take my advice with a word of caution.

I created a couple of simple macros to reduce the number of keystrokes needed to perform actions that were repeated frequently. They worked as intended from the visual basic environment. They didn't work when I added them to the quick access toolbar. 

1. I tried saving my document as a .docm then closed and reopened it, no joy I messed around with the toolbar without any success.

2. I read the advice from Peter.

2. I played with the trust center and ended up with following selections:

Enable all macros (not recommended; potentially dangerous code can run)

Trust access to the VBA project object model

Now they work. Good luck

Jeff

April 2nd, 2015 12:31pm

I had the same problem Ian, I'm not a Microsoft engineer (just a user) and I am using Word 2013 so take my advice with a word of caution.

I created a couple of simple macros to reduce the number of keystrokes needed to perform actions that were repeated frequently. They worked as intended from the visual basic environment. They didn't work when I added them to the quick access toolbar. 

1. I tried saving my document as a .docm then closed and reopened it, no joy I messed around with the toolbar without any success.

2. I read the advice from Peter.

2. I played with the trust center and ended up with following selections:

Enable all macros (not recommended; potentially dangerous code can run)

Trust access to the VBA project object model

Now they work. Good luck

Jeff

Jeff,

You should not need Trust All Macros. You do need to trust access to the VBA project model.

Just either use signed projects or place your macro-enabled templates (or, if needed, documents) in a Trusted Location. I seldom put macros in documents directly.

Save any QAT modification in the same template that stores the macro rather than for all documents.
Modifying the QAT and Ribbon in Microsoft Word

Free Windows Admin Tool Kit Click here and download it now
April 2nd, 2015 1:34pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics