none
Issues Enabling Macros RRS feed

  • Question

  • Hello,

    I have recently started using vba to control word rather than my comfort zone which is Excel.

    I am working an a secure network and therefore have limited access to settings etc. I have been given a word document which was developed in word 1997-2003 and I have now tried to update the document with some simple macros.

    My issue is that the document will be very temperamental, sometimes when I open it, the macros will work fine without me having to do anything. But then I open them up again and the "Enable Macros" button is present at the top of the page. At this point the macros are not working and when I click the enable button they will still not function. I proceed to open up vba and run the code manually and I get the message saying that Macros are disabled, even though I just clicked the button saying enable. I will then close and open the document and sometime later I will come back to the document and all macros will be working. Very strange :s.

    I have followed many forums but none seem to have an error the same. I feel ti may be something to do with the Normal template which the document is reading from. I have tried to alter and the normal template and ocassionaly this forces the macros to work for a short while but they eventually get disabled again.

    Any advice would be appreciated!

    Many thanks,

    Andy

    Monday, March 21, 2016 2:15 PM

Answers

  • Unless the document has acquired some form of corruption, enabling and running Word macros should be no more difficult than doing the same for Excel macros. Corrupt documents can often be 'repaired' by inserting a new, empty, paragraph at the very end, copying everything except that new paragraph to a new document based on the same template (headers & footers may need to be copied separately), closing the old document and saving the new one over it.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by David_JunFeng Wednesday, March 30, 2016 9:39 AM
    Tuesday, March 22, 2016 4:35 AM

All replies

  • Unless the document has acquired some form of corruption, enabling and running Word macros should be no more difficult than doing the same for Excel macros. Corrupt documents can often be 'repaired' by inserting a new, empty, paragraph at the very end, copying everything except that new paragraph to a new document based on the same template (headers & footers may need to be copied separately), closing the old document and saving the new one over it.

    Cheers
    Paul Edstein
    [MS MVP - Word]

    • Marked as answer by David_JunFeng Wednesday, March 30, 2016 9:39 AM
    Tuesday, March 22, 2016 4:35 AM
  • Hi, AndyG1991

    According to your description, have you created a trusted location for your files? if not, you should use a trusted location to store a file when you don't want that file to be checked by the Trust Center security feature when you open the file. For example, you might want to open a document that contains a macro that the Trust Center disables because the Trust Center considers the macro unsafe. If you think that the document and the macro in the document are from a trustworthy source, it is better to move the document to a trusted location, instead of changing the default Trust Center settings to a less safe macro security setting. When you open the file from the trusted location, it is not checked by the Trust Center security feature, you won't receive any security alerts, and the macro is enabled.

    For more information, click here to refer about Create, remove, or change a trusted location for your files

    Tuesday, March 22, 2016 6:49 AM