Opening a Workbook and Suppressing Automatic Macros

Written by Allen Wyatt (last updated February 16, 2023)
This tip applies to Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365


1

When you open a workbook, Excel normally runs any automatic macros that are saved with the workbook. Paul notes that in previous versions of Excel he could hold down the Shift key as the workbook was opened and Excel would not run the automatic macros. In Excel 2007 this doesn't seem to work for Paul, so he wonders if Microsoft has changed this convention.

The short answer is no, Microsoft has not changed this convention. When you open a workbook and hold down the Shift key as it is opening, Excel should ignore any automatic macros set up for the workbook. If that behavior is not what you are experiencing on your system, it could be that you aren't actually holding down the Shift key at the start of the loading process or you aren't holding it down long enough. Make sure you hold the Shift key as you click on the Open button (in the Open dialog box) or as you click the file in the MRU.

For a great, in-depth exposition of how all this works, visit this page on the site maintained by Excel MVP Jan Karel Pieterse:

https://www.jkp-ads.com/Articles/preventopenevent.asp

Note:

If you would like to know how to use the macros described on this page (or on any other page on the ExcelTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

ExcelTips is your source for cost-effective Microsoft Excel training. This tip (8769) applies to Microsoft Excel 2007, 2010, 2013, 2016, 2019, and Excel in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Find and Replace in a Column or Row

Need to search for information in a table? Word allows you to easily limit your search to an entire column or row, as ...

Discover More

Moving Macros from the Personal Workbook

Need to move a macro out of your Personal.xls workbook and into a regular workbook? You can do it using familiar editing ...

Discover More

Moving Part of a Footer Down a Line

Setting up a single footer line for your printouts is fairly easy. If you want to move part of the footer down a line so ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More ExcelTips (ribbon)

Saving an Unsavable Workbook

Macros can allow you to do some fancy data validation in your workbooks, such as checking to see if the user entered ...

Discover More

Creating a Plus/Minus Button

Want a quick way to convert positive values to negative and vice versa? You can create your own plus/minus button by ...

Discover More

Dissecting a String

VBA is a versatile programming language. It is especially good at working with string data. Here are the different VBA ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is nine minus 1?

2023-02-16 08:10:40

John M

Per the linked article by Jan Karel Pieterse, he claims that Excel 365 has changed the Shift behavior and it no longer works for 365. Be sure to check the article for a few workarounds.


This Site

Got a version of Excel that uses the ribbon interface (Excel 2007 or later)? This site is for you! If you use an earlier version of Excel, visit our ExcelTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.