To enable macros in Excel on Windows 11, open the workbook and click Enable Content on the yellow Security Warning bar below the ribbon. If you don’t see that bar, go to File > Options > Trust Center > Trust Center Settings > Macro Settings and choose Disable VBA macros with notification, which lets you enable macros file by file. If the bar is red and says Microsoft has blocked macros, the file came from the internet: close it, right-click the file in File Explorer, choose Properties, check Unblock, and click OK.
Macros can run harmful code, so only enable them in files you trust. This guide covers each way to enable macros, trusted locations for files you use often, the internet block, and fixes when macros still won’t run. Steps are for Excel for Microsoft 365, Excel 2024, 2021, 2019, and 2016 on Windows 11.
Method 1: Enable macros for one file
- Open the macro-enabled workbook (usually .xlsm, .xlsb, or .xls).
- On the yellow SECURITY WARNING Macros have been disabled bar, click Enable Content.
Excel usually remembers this choice for that file (it becomes a trusted document), so you won’t be asked again unless the file moves or changes.
To enable macros for this session only, click File > Info > Enable Content > Advanced Options and choose Enable content for this session.
Method 2: Change the Trust Center macro settings
- Click File > Options.
- Click Trust Center, then Trust Center Settings.
- Click Macro Settings.
- Choose an option:
- Disable VBA macros without notification – blocks all macros silently.
- Disable VBA macros with notification – the default and recommended option; shows the Enable Content bar.
- Disable VBA macros except digitally signed macros – runs macros signed by trusted publishers.
- Enable VBA macros – runs all macros without asking. Not recommended.
- Click OK twice.

These settings apply to Excel only. Word and PowerPoint have their own Trust Center settings.
Method 3: Unblock files from the internet
Microsoft Office blocks macros in files that come from the internet (including email attachments and downloads) by default. You’ll see a red SECURITY RISK bar, and there’s no Enable Content button.
- Close the workbook.
- In File Explorer, right-click the file and choose Properties.
- On the General tab, check Unblock next to the security message, and click OK.
- Open the file again and click Enable Content.
If there’s no Unblock checkbox, the file may be on a network location or blocked by your organization’s policy.
Method 4: Use a trusted location
Files in a trusted location open with macros enabled and no warning, which is handy for your own macro workbooks.
- Go to File > Options > Trust Center > Trust Center Settings > Trusted Locations.
- Click Add new location, browse to a folder, and optionally check Subfolders of this location are also trusted.
- Click OK.
Only use folders that you control. Avoid trusting your whole Downloads or Documents folder.
Show the Developer tab
To run, record, or edit macros, turn on the Developer tab: File > Options > Customize Ribbon, check Developer, and click OK. Then use Developer > Macros (or Alt + F8) to run a macro and Visual Basic (or Alt + F11) to edit code.
Troubleshooting
- No Enable Content button – the file is blocked from the internet (see Method 3), or your macro setting is Disable without notification.
- Macros are gone after saving – save as Excel Macro-Enabled Workbook (*.xlsm). The regular .xlsx format can’t store macros.
- Settings are grayed out – your organization manages macro settings through policy. Contact IT.
- Macro runs but errors – the code may reference missing files, references, or features. Open the VBA editor, click Tools > References, and look for items marked MISSING.
- Excel for the web – it can’t run VBA macros. Open the file in the desktop app.
Frequently asked questions
Is it safe to enable macros?
Only for files you trust from people you know. Malicious macros are a common way to spread malware, especially through email attachments.
What’s the difference between VBA macros and Office Scripts?
VBA macros run in the desktop app. Office Scripts use TypeScript and run in Excel for the web and newer desktop versions for supported business accounts.
Do these steps work on Windows 10?
Yes. Excel’s Trust Center settings are the same on Windows 10 and Windows 11.

Kermit Matthews runs Live2Tech from just outside Philadelphia. He is an IT specialist with over 20 years of experience, from a university help desk to small-business IT, IT management and his own consulting practice, and has written tech guides full time since 2020. Steps are checked against the current software on a real device or the maker’s official documentation. More about Kermit.