bottom
Great ExcelTips!
         
Your e-mail address is safe!
Close Note

Tips.Net > ExcelTips Home > Macros > Getting Rid of the "Enable Macros" Notice

Getting Rid of the "Enable Macros" Notice

Summary: Do you get tired of the dialog box that says “do you want to enable macros” that is displayed when you open a workbook. You can get rid of it by getting rid of the modules that used to hold your long-gone macros. (This tip works with Microsoft Excel 97, Excel 2000, Excel 2002, Excel 2003, and Excel 2007.)

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:

  1. Press Alt+F11 to display the Visual Basic Editor.
  2. Near the upper-left side of the editor is the Project Explorer. This contains a hierarchical tree that shows the different modules in your workbook. If the Project Explorer is not visible on your screen, press Ctrl+R to display it.
  3. Within the Project Explorer should be a folder called Modules. If it is not already open, double-click on the Modules folder to display its contents.
  4. Right-click on a module in the folder. A Context menu is displayed.
  5. Choose the Remove option from the Context menu. You are asked if you want to export the module before removing it.
  6. Click on the No button. The module is removed.
  7. Repeat steps 5 through 7 for each module in the Modules folder.
  8. Close the Visual Basic Editor.
  9. Resave your workbook.

At this point your workbook contains no modules, and you will not get any notification when you subsequently open it.

Tip #2587 applies to Microsoft Excel versions: 97 | 2000 | 2002 | 2003 | 2007


Save Time and Money! Many people need to keep track of employee time, but don't know where to start when it comes to creating a spreadsheet. Here's a way to save time, effort, and money with ready-to-use timesheet templates.
 
Check out Timesheet Templates today!

Helpful Links

Ask an Excel Question
Make a Comment

Tips.Net Home

ExcelTips FAQ
ExcelTips Premium

Learn Access Now

Bugs and Pests Tips
ExcelTips
Family Tips
Health Tips
Home Tips
Organizing Tips
WordTips

Advertise on the
ExcelTips Site

 

Great Info!

Get tips like this every week in ExcelTips, a free productivity newsletter. Enter your e-mail address and click "Subscribe."
     
(Your e-mail address will never be shared with anyone, ever.)