Friday, December 20, 2013

OPEN WORD DOCUMENTS WITHOUT RUNNING STARTUP MACROS

In our office, I have been creating a number of MS Word templates that run macros or other code as soon as they are opened. It could be code that the macro automatically adds our letterhead to the document or that it pulls up a user form that gets information from the place in the document.

People prefer to access these templates in different ways; they sometimes open the template and other times they add a new document based on the template. I have found that it is sometimes easier to code around people's preferences than to try to get them to change their preferences. As a result, I have the templates set up to run the code regardless of how they access the document.

The up side to this is that the end users have the code run regardless of how they enter the document. The down side is that it could make it harder to edit the template when changes need made. In fact, I thought I had created uneditable templates because no matter how the template was opened, it always created a new document and would not give me a chance to change the template. This, naturally, led to frantic Google searching.

The point of this story is to point out that you can open a template or other document without running any macros or code that are otherwise supposed to run at start. To do so, hold down the shift key while the document opens, and none of those codes will run.

Just hoping to help out others who may have a similar problem.

1 comment:

  1. Very useful tip! I was caught in the same trap - you saved me a load of work. Thanks.

    ReplyDelete