Whether you’re an Excel beginner or a power user, macros boost your productivity by performing repetitive tasks. Macros are small programs or scripts in VBA (Visual Basic for Applications) codes that make your workflow efficient while dealing with complex workbooks. While macros are useful, they pose security risks when you open an Excel file from untrusted sources. Disabled by default, here’s how to tweak macros settings in Microsoft Excel.



Microsoft offers Excel apps for Windows, Mac, iPhone, iPad, Android, and on the web to make tweaks from a
Chromebook
. However, you can change macro security settings only from the desktop apps.


Related

The best Excel templates for every use case

There’s an Excel template for anything you want to do


What is a macro in Microsoft Excel?

Before we start, let’s take a quick look at macros in Microsoft Excel. Macros are small programs that automate daily tasks in Excel. Macros are available in all Microsoft Office apps, including Word, PowerPoint, and Excel.

A macro records your keystrokes and mouse clicks and lets you execute complex tasks with a single click. Macros can be timesavers for Microsoft 365 users. For instance, you can create a macro and add a formatted table to an Excel sheet or your business letterhead in a Word document in no time. The possibilities are endless.


Advantages of using macros in Excel

Here are a couple of benefits of using macros in Excel.

  • Save time with tedious, repetitive tasks: Create macros and combine your repetitive clicks and keystrokes.
  • Reduce errors: Manually entering repetitive spreadsheet data can lead to errors. A macro helps you eliminate such errors.



Dangers of using macros in Excel

Before you activate macros on all Excel workbooks, it’s important to understand the consequences of using them. A malicious macro can corrupt your files, steal your data, infect your PC with malware, and put your PC at security risk. That’s why Microsoft disables macros by default in all Microsoft 365 apps.


Enable or disable macros in Excel for Windows

You can manage macros for all your workbooks from Trust Center settings. Follow the steps below to make changes.

  1. Launch Excel on Windows.
  2. Select File in the upper-left corner.
    File menu in Microsoft Excel
  3. Select More and click Options.
    Microsoft Excel options
  4. Select Trust Center and open Trust Center Settings.
    Microsoft Excel trust center settings
  5. Go to Macro Settings and find different options to choose from.
    Microsoft Excel macro options


Here’s an explanation of the options available in Macro Settings:

  • Disable VBA macros without notification: Blocks all macros without a warning message. Avoid this option since you can’t run any macro, even if they are safe and trusted.
  • Disable VBA macros with notification: The default behavior of VBA macros with a security warning.
  • Disable VBA macros except digitally signed macros: Disables all macros except ones digitally signed by trusted publishers. If a macro is signed by an untrusted publisher, you see a warning message with an option to enable the macro.
  • Enable VBA macros (not recommended; potentially dangerous code can run): Enables macros without any conditions. It’s the least secure option and exposes your PC to malicious code.


Enable macros for a single Excel file

When you open an Excel file from untrusted sources, Microsoft blocks macros from running and shows a security risk warning. You can tweak file properties and run macros without a warning banner.



  1. Launch File Explorer and go to the location where you saved the Excel file.
  2. Right-click the file and select Properties from the context menu.
    Excel file properties
  3. Under Security, click the checkmark beside Unlock and select Apply. Click OK.
    Unblock an Excel file


Enable macros for a trusted location on a PC

A trusted location marks all your files safe and opens them without a warning message. Trust Center doesn’t check files from trusted locations and enables all macros.

Microsoft Excel treats the added location as a trusted source for opening files. Make sure the new location is secure.



  1. Go to the Options menu in Microsoft Excel (refer to the steps above).
  2. Click Trust Center and head to Trust Center Settings.
  3. Select Trusted Locations from the sidebar. Click Add new location. You can also remove an existing trusted location, allow trusted locations on your network (not recommended by Microsoft), and disable all trusted locations.
    Trusted locations in Microsoft Excel
  4. Select Browse. If you want to include subfolders in a trusted location, select Subfolders of this location are also trusted.
    Browse locations in Microsoft Excel
  5. When the File Explorer menu appears, find a folder you want to treat as a trusted location and click OK.
    Select a trusted folder in Microsoft Excel


Enable or disable macros in Excel for Mac

Excel for Mac users can go through the steps below to manage macros.

  1. Open Excel on Mac.
  2. Select Excel at the top and select Preferences.
    Open Microsoft Excel preferences
  3. Select Security under Sharing and Privacy.
    Security settings for Microsoft Excel
  4. Check Macro Security options and click a radio button beside a relevant option.
    Macros settings for Microsoft Excel


These options are identical to the above. To learn about each macro security option, refer to the section above.


Understand macros settings in Excel

You can manage macro settings in Excel in various ways. We recommend enabling them for a single file or a trusted location. Switching on macros for all Excel files can put your PC or Mac at security risk.

Do you want to create and record macros to streamline repetitive data entries and formatting processes in Excel? Check out our guide for recording and running Excel macros.