Please Note: This article is written for users of the following Microsoft Excel versions: 2007, 2010, and 2013. If you are using an earlier version (Excel 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Excel, click here: Getting Rid of the "Enable Macros" Notice.
by Allen Wyatt
(last updated February 14, 2015)
The VBA programming language included with Excel allows you to create very powerful macros. It is not uncommon to record a couple of macros for a workbook, each designed to accomplish a quick little task. When you create the macros, Excel adds what is called a module to your workbook. This module is used to store the macros that you record or create.
You may notice that every time you open a workbook that contains macros, Excel asks you if you want to enable the macros. This is part of the security system built into Excel. (This system has saved my bacon on more than one occasion.) You may also have noticed that if you delete all the macros in your workbook, Excel still asks you if you want to enable macros when you later open the workbook.
Why would Excel do this? After all, you deleted all the macros in the workbook, right? The reason is that the module automatically created by Excel to hold your macros is not automatically deleted when you get rid of the last macro—it's still there. As long as the module is there, Excel will dutifully ask you if you want to enable your macros whenever you load the workbook.
To overcome this problem (and get rid of the macro prompt for this particular workbook), follow these steps:
At this point your workbook contains no modules, and you will not get any notification when you subsequently open it.
Of course, there is a technique that may be much simpler for your needs: Just use the Save As command and change the file type to an XLSX file. These workbook files cannot contain macros, so any macros that are in the current workbook are stripped out in the saving process.
ExcelTips is your source for cost-effective Microsoft Excel training. This tip (10399) applies to Microsoft Excel 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Excel here: Getting Rid of the "Enable Macros" Notice.
Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!
When you open multiple workbooks, the way in which Excel sizes them is not the best for your needs. This tip looks at a ...Discover More
Want to stop Excel from running any automatic macros that may be stored with a workbook? Here's how to do it.Discover More
Macros often need to select different cells in a worksheet. Here's how you can use macro commands to change which cell is ...Discover More
FREE SERVICE: Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.