To enable macros in Excel for Microsoft 365, open the workbook and click Enable Content in the yellow security bar at the top. That trusts that file, and Excel remembers it next time. To change the setting for all workbooks, go to File > Options > Trust Center > Trust Center Settings > Macro Settings. If Excel shows a red bar saying macros have been blocked, the file came from the internet and you need to unblock it first. Here’s how each option works and which one to choose.

Before you enable macros
Macros are small programs, and they can change files, download things, or install malware. Only enable macros in files you expected to receive from someone you trust, or that you created yourself. If an unexpected email attachment asks you to “enable content to view the document,” that’s a common malware trick.
Method 1: Enable macros for one workbook
- Open the workbook. If it contains macros, a yellow bar says SECURITY WARNING Macros have been disabled.
- Click Enable Content.
Excel adds the file to its trusted documents, so you won’t be asked again for that file. If you’ve already closed the bar, go to File > Info, click Enable Content, and choose Enable All Content.
Enable macros for this session only
If you don’t want Excel to remember the file as trusted, go to File > Info, click Enable Content > Advanced Options, choose Enable content for this session, and click OK. The macros run until you close the workbook, and you’ll be asked again next time.
Method 2: Unblock a file from the internet
For files downloaded or opened from email, Excel may show a red bar: SECURITY RISK Microsoft has blocked macros from running because the source of this file is untrusted. There’s no Enable Content button in this case.
- Close the workbook.
- In File Explorer, right-click the file and choose Properties.
- On the General tab, tick Unblock near the bottom and click OK.
- Open the file again and click Enable Content.
If there’s no Unblock checkbox, the file isn’t blocked, and Method 1 applies.
Method 3: Trust a folder (Trusted Locations)
If you work with macro files from one folder regularly, make that folder trusted. Files in it open with macros enabled and no warnings.
- Go to File > Options > Trust Center and click Trust Center Settings.
- Click Trusted Locations, then Add new location.
- Browse to the folder, tick Subfolders of this location are also trusted if you want, and click OK.
Choose a specific folder you control, not Downloads or your whole Documents folder.
Method 4: Change the macro setting for all workbooks
- Go to File > Options > Trust Center > Trust Center Settings.
- Click Macro Settings and choose one:
- Disable VBA macros without notification: blocks all macros silently.
- Disable VBA macros with notification: the default and recommended setting. You get the Enable Content prompt.
- Disable VBA macros except digitally signed macros: runs only macros signed by trusted publishers.
- Enable VBA macros (not recommended): runs every macro in every file. Avoid this.
- Click OK and restart Excel.
On work computers, your IT department may control these settings, and some options can be greyed out.
Save files so macros are kept
A standard .xlsx workbook can’t store macros. When saving a workbook with macros, choose Excel Macro-Enabled Workbook (*.xlsm) in the Save as type list. Otherwise Excel warns that the VBA project will be lost.
Next steps
Once macros are enabled, see how to run macros in Excel and how to record a macro in Excel. To remove macros from a file, see how to remove macros from Excel.
Troubleshooting
Enable Content doesn’t appear
The macro setting may be set to disable without notification, or the file is blocked (red bar). Check Methods 2 and 4.
The Developer tab is missing
Go to File > Options > Customize Ribbon and tick Developer.
Macros worked yesterday but not today
The file may have been moved, renamed, or re-downloaded, which removes its trusted status. Enable it again, or keep it in a trusted location.
Frequently asked questions
Can I use macros in Excel for the web?
No. Excel for the web can’t run VBA macros. It supports Office Scripts instead. Open the file in the desktop app to use macros.
How do I enable macros on a Mac?
Go to Excel > Settings > Security (or Preferences on older versions). See how to enable macros in Excel on Mac.
Is this the same in Excel 2021 or 2019?
Yes. The Trust Center steps are the same in recent versions of Excel for Windows. See also how to enable macros in Excel on Windows 10.
Summary
Click Enable Content for a file you trust. Unblock downloaded files in their Properties first, add folders you use regularly to Trusted Locations, and leave the default “Disable VBA macros with notification” setting in the Trust Center.

Matt Jacobs has been working as an IT consultant for small businesses since receiving his Master’s degree in 2003. While he still does some consulting work, his primary focus now is on creating technology support content for SupportYourTech.com.
His work can be found on many websites and focuses on topics such as Microsoft Office, Apple devices, Android devices, Photoshop, and more.