How to Enable or Disable Macros in Office 365
In this article
To enable or disable macros in Office 365 (Microsoft 365), open the Trust Center in the desktop app: go to File > Options > Trust Center > Trust Center Settings > Macro Settings, then pick the option you want and click OK. This applies to Word, Excel, PowerPoint and Outlook on Windows. On Mac, the path is slightly different: app menu > Preferences > Security (or the app's equivalent security section). Macros are small programs that automate tasks, and they can also carry malware, so the setting you choose is a security decision, not just a convenience one. The steps below cover the desktop apps, which are where the macro controls live; the browser versions of Office do not run VBA macros at all.
What You'll Need
- A desktop installation of Microsoft 365 apps (Word, Excel, PowerPoint or Outlook) on Windows or Mac. The web versions cannot run or manage macros.
- Admin rights on the PC if you want to change the setting for all users, or if the option is greyed out by policy.
- Knowledge of whether the file is from a trusted source. Only enable macros in documents you or your organisation created or verified.
Step-by-Step
- Open the app and a document. Launch Word, Excel or PowerPoint and open any file, or create a blank one. The macro setting is app-wide, so you only need one document open.
- Go to File > Options. On Windows, click File in the top-left corner, then Options at the bottom of the left-hand menu. On Mac, use the app menu (for example Excel) and choose Preferences.
- Open the Trust Center. In the Options window, select Trust Center in the left column, then click the Trust Center Settings button on the right. On Mac, look for Security in the Preferences window.
- Select Macro Settings. In the Trust Center dialog, click Macro Settings in the left column. You will see four radio buttons on Windows: Disable all macros without notification, Disable all macros with notification, Disable all macros except digitally signed macros, and Enable all macros.
- Choose your setting. For most people, Disable all macros with notification is the right balance: macros are blocked by default, but a yellow message bar appears when a file contains macros so you can enable them for that file only. Choose Disable all macros without notification if you never use macros and want no prompts. Choose Disable all macros except digitally signed macros in managed environments where signed macros are trusted. Avoid Enable all macros unless you fully understand the risk; it runs any macro without asking.
- Decide on the checkbox. On Windows you will also see "Enable Excel 4.0 macros when VBA macros are enabled" (wording varies by app). Leave it unticked unless you specifically rely on old Excel 4.0 macro sheets, which are a common malware vector.
- Click OK twice. Confirm with OK in the Trust Center Settings dialog, then OK in the Options window. The change takes effect immediately for that app; repeat the steps in each Office app you use, because the setting is stored per application.
- Handle a macro-enabled file. With the notification option selected, open the file and look for the yellow Message Bar below the ribbon. Click Enable Content only if you trust the source. If you clicked it by mistake, close the file without saving and reopen it; the prompt returns.
- To disable again, return to the same Macro Settings screen and select Disable all macros with notification or Disable all macros without notification. This is also the fastest fix if you enabled macros for a file and want to stop them running next time.
Common Mistakes
- Changing the setting in one app and assuming it applies everywhere. Word, Excel, PowerPoint and Outlook each keep their own macro setting.
- Clicking Enable Content out of habit on every file. The prompt exists so you make a per-file decision; enabling blindly defeats it.
- Confusing the Message Bar with a normal warning dialog. The bar sits under the ribbon and can be missed on small screens.
- Looking for macro settings in the browser version of Office. They are not there, because macros do not run in the web apps.
- Assuming a password-protected or read-only file is safe. Protection does not remove macros; it only limits editing.
- Forgetting that a policy set by an IT administrator can override your choice and grey out the options.
Tips
- Keep the notification option on rather than disabling silently. You still get a warning, but nothing runs until you say so.
- Use the Trust Center's Trusted Locations section to allow macros from a specific folder you control, such as a work templates directory, instead of enabling macros globally.
- If you only need to see a file's contents, open it in the web version of Office or in Protected View, where macros cannot run.
- Check the file extension: .xlsm, .docm and .pptm indicate macro-enabled files, while .xlsx, .docx and .pptx normally do not contain VBA macros.
- When sharing files, remove macros you no longer need by saving a copy in the standard (non-macro) format.
Troubleshooting
If the Message Bar never appears and macros seem to run silently, your setting is probably Disable all macros without notification or Enable all macros. Recheck Macro Settings and switch to the notification option.
If the macro options are greyed out, the app is likely managed by your organisation. Group Policy or a cloud policy can lock these settings; contact your IT administrator rather than trying to work around it.
If a macro still will not run after you enable content, the file may be blocked by Windows itself. Right-click the file in File Explorer, choose Properties, and look for an Unblock checkbox on the General tab; tick it and click OK. Only do this for files you trust.
If the Trust Center window will not open, close all Office apps, restart the PC, and try again. A damaged user profile or a pending update can also cause odd behaviour, so install any available Office updates first.
If macros work in one app but not another, remember the setting is per app and repeat the steps in the second program.
Frequently Asked Questions
Do macros work in Office on the web?
No. The browser versions of Word, Excel and PowerPoint do not run VBA macros. You need the desktop app to use them.
What is the safest macro setting?
Disable all macros with notification. It blocks macros by default but lets you enable them for a specific trusted file when needed.
Does changing the setting affect files I already opened?
The setting applies going forward. Files you previously enabled content for may still open without a prompt depending on how they were trusted, so recheck any file you are unsure about.
Why can't I change the macro settings?
Your organisation has probably locked them through policy. Only an administrator can change that.
Are digitally signed macros safer?
They are more trustworthy because the signature identifies the publisher and shows the file has not been altered since signing. That is why the signed-macros-only option exists, but it still relies on trusting that publisher.
How do I stop a macro from running once it has started?
Press Esc or Ctrl+Break (Ctrl+C on some keyboards) to interrupt VBA code. If the file misbehaves, close it without saving and lower your macro setting before reopening.