How-To

How to Enable or Disable Macros in Excel

Working in spreadsheets

Macros can make your spreadsheets even more powerful, but they also come with risks. Learn how to enable or disable macros in Excel using this guide.

Do you find yourself performing repetitive tasks in Excel and wishing that you could automate them? The good news is that you can. Excel macros can perform repetitive sequences of actions for you so that you don’t have to.

Macros come with risks—it’s possible for people to create malicious macros that can infect your computer with malware when you open them. That’s why macros are disabled by default in Excel. Turning them back on is simple enough to do, however.

Here’s how to enable or disable macros in Excel.

What Are Macros?

A macro is a set of instructions that tells Excel to perform an action or sequence of actions. They can save you from performing repetitive tasks in Excel.

In their simplest form, you can record a sequence of actions in Excel and save them as a macro. Running your macro will then perform that same sequence of actions as many times as you wish. For example, you might want to insert multiple sheets into your document. Inserting them one at a time isn’t ideal, but a macro can insert as many sheets as you would like by repeating the same steps for you, over and over again.

You can make macros even more powerful by using the Visual Basic (VBA) programming language to write your own macros rather than merely recording them. This allows you to create highly complex macros that can do almost anything you wish.

Why Would You Want to Disable Macros in Excel?

Macros can make your life easier, but there is a risk when using them. That’s because when you open a file created by someone else that contains macros, you have no idea what those macros are. It is possible to insert macros into Excel documents that can cause serious harm to your computer. These malicious macros can spread viruses and other forms of malware, which can have serious consequences.

For this reason, macros are disabled by default in Excel. When you open a document containing macros, you will be asked to confirm that you want to enable macros. You should only do so if you trust the document.

Even if it was sent to you from someone you know, you should be wary. Many macro viruses will access contact lists and send out emails from your account, allowing the viruses to spread.

How to Enable Macros in Excel

If you are certain that a document containing macros is safe, enabling macros in the document is quick and easy to do. Excel works slightly differently on Windows and Mac, so the exact steps will depend on the operating system that you’re using.

How to Enable Macros in Excel on Windows

When you open an Excel file containing macros on Windows, by default you’ll get a notification that the file contains macros and be given the option to enable or disable them. You can also choose to permanently enable macros for any files that you open.

To enable macros in Excel on Windows:

  1. Open the Excel file containing macros—you will see a warning just above the formula bar.
  2. To enable macros, click Enable Content.
    enable content excel
  3. If you don’t click this button, you can continue to use the spreadsheet as normal, but you won’t be able to run any macros.

If you find yourself clicking this button every time you use Excel, you can change the default settings so that macros are automatically enabled for all Excel files. You should only do this if you’re certain that the files you are opening are safe.

To permanently enable macros in Excel on Windows:

  1. Open any Excel file.
  2. Click File.
    excel file menu
  3. Select Options at the very bottom of the menu.
    excel options
  4. Click the Trust Center menu.
    excel trust center
  5. Click the Trust Center Settings button.
    excel trust center settings
  6. Select the Macro Settings menu.
    excel macro settings
  7. Click the Enable VBA Macros radio button.
    excel enable macros
  8. Click OK.
  9. Close your document. When you open any Excel document from now on, macros will automatically be enabled.

How to Enable Macros in Excel for Mac

If you’re using Excel for Mac, you can enable macros directly through the document that you’re opening. You can also opt to always enable macros for every file you open.

To enable macros in Excel for Mac:

  1. Double-click the file you want to open as you normally would. You will see a pop-up warning you that the file contains macros.
  2. Click Enable Macros to open the file with macros enabled.
    excel enable macros mac
  3. If you don’t trust the document, click Disable Macros and the file will open, but all macros will be disabled.
    excel disable macros mac
  4. You can now use your Excel file as usual.

If you disable macros when you open a document, there’s no way to enable macros for that document without closing the file and opening it again. You can, however, change the default setting so that macros are always enabled when you open any Excel file.

You should only do this if you’re certain that the files are safe to open, however.

To permanently enable macros in Excel for Mac:

  1. Open any Excel file.
  2. Click Excel in the menu bar.
    mac excel menu
  3. Select Preferences.
    mac excel preferences
  4. Click the Security icon.
    mac excel security
  5. Select Enable All Macros.
    excel enable all macros mac
  6. If the file you opened initially contains macros, you’ll need to close it and open it again for the new setting to take effect.

How to Disable Macros in Excel

If you’re concerned about the risks from malicious macros, you can choose to disable macros by default.

There are two options. The first is to disable macros by default, but keep the notification that the file contains macros that will appear when you open the file. You can then decide whether or not to enable macros for that file.

The second option is to disable macros by default and remove the notification. This is useful if you never want to enable macros, as it means you don’t see the same pop-up notification every time you open a file containing macros.

How to Disable Macros in Excel on Windows

The methods for disabling macros are slightly different depending on your operating system.

To disable macros in Excel on Windows:

  1. Open any Excel document.
  2. Click File.
    excel file menu
  3. At the bottom of the menu, select Options.
    excel options
  4. Select the Trust Center menu.
    excel trust center
  5. Click Trust Center Settings.
    excel trust center settings
  6. Select Macro Settings.
    excel macro settings
  7. If you want macros to be disabled, but to still have the option to enable them via the message above the formula bar, click the Disable VBA Macros With Notification radio button.
    excel disable macros with notifications
  8. If you want macros to be disabled, and you don’t want to see the notification, click the Disable VBA Macros Without Notification radio button.
    excel disable macros without notifications
  9. You can also choose to only enable macros that have been digitally signed.
    excel disable macros except signed
  10. Click OK to save your settings. You may need to close and re-open your file for the new settings to take effect.

How to Disable Macros in Excel on Mac

If you’re using Excel for Mac, you’ll need to do things a little differently.

To disable macros in Excel for Mac:

  1. Open any Excel file.
  2. Click the Excel menu in the menu bar.
    mac excel menu
  3. Select Preferences.
    mac excel preferences
  4. Click the Security icon.
    mac excel security
  5. To disable macros but keep the notifications, select Disable All Macros With Notification.
    mac excel disable macros with notification
  6. To disable macros and stop the notifications, select Disable All Macros Without Notification.
    mac excel disable macros without notification
  7. You’ll need to close and re-open the current file for the new changes to take effect for that file.

Do More With Excel

Macros can be incredibly useful when working in Excel, but they do come with risks, especially if you’re unsure of the macro’s true source. Knowing how to enable or disable macros in Excel can ensure that you get all the benefits of macros without putting your computer at risk.

Macros are just one way you can harness the impressive power of Excel. For example, it’s possible to create stunning 3D maps in Excel. You can use web scraping to import data into Excel directly from the web. You can even have Excel ring an alarm when your data hits certain values.

Click to comment

Leave a Reply

Your email address will not be published. Required fields are marked *

 

To Top