Macros are not being switched off for everyone. What is actually changing is Microsoft's default behaviour: in current Microsoft 365 builds, Excel blocks VBA macros in files downloaded from the internet, opened from email attachments, or received through other "unsafe" sources, and shows a warning banner instead of running the code. Microsoft's long-term direction for automation is Office Scripts, but VBA is still supported and there is no deadline after which your existing macros stop working on their own. The practical task is therefore not "remove your macros" but "understand why they stopped running and choose a safe, working way forward" — unblock trusted files, move to Office Scripts where it fits, and stop depending on macro files that arrive from outside. The steps below walk through checking whether macros are actually gone, re-enabling trusted ones safely, moving critical automation to Office Scripts, and cleaning up the macro files you no longer want.

What You'll Need

  • Excel for Microsoft 365 on Windows or Mac, or Excel on the web (Office Scripts requires Microsoft 365; VBA is Windows and Mac only, not in Excel for the web).
  • A file that previously used macros, saved as .xlsm, .xlsb or .xls, so you can test whether it still runs.
  • Administrator or IT approval if a group policy blocks macros across your organisation — personal settings cannot override company policy.
  • Access to OneDrive or SharePoint if you plan to use Office Scripts, since scripts are stored in the workbook's cloud file, not in a local copy.
  • A backup copy of any macro workbook before you edit, re-save or convert it.

Step-by-Step

  1. Confirm what is actually blocked. Open the workbook and look for a yellow or red message bar under the ribbon naming the macro source and offering a button such as Enable Content. If your macros simply do not run and there is no ribbon tab for them, first check whether the file opened in Protected View. Menu names vary slightly by Excel version, platform and region, so treat the labels below as a guide.
  2. Check whether the file was flagged as coming from the internet. On Windows, close the file, right-click it in File Explorer, choose Properties, and look for an Unblock checkbox or a security note at the bottom of the General tab. If it is present, tick Unblock, click Apply, then reopen the workbook. This is the single most common reason a macro that used to work suddenly will not run.
  3. Check the Trust Center. In Excel go to File > Options > Trust Center > Trust Center Settings > Macro Settings (on Mac: Excel > Preferences > Security & Privacy). The recommended posture is Disable VBA macros with notification, which keeps the enable bar available for files you trust. Do not select Enable all macros — it removes the last line of defence against a malicious attachment.
  4. Use a Trusted Location instead of loosening global settings. In the same Trust Center, open Trusted Locations and add a folder you control, such as a dedicated work folder on your own drive. Files stored there open without the warning bar. Keep that folder small and never point a Trusted Location at your Downloads folder or a shared network share that other people can write to.
  5. Save the file in the right format. A workbook containing VBA must be saved as Excel Macro-Enabled Workbook (.xlsm) or Excel Binary Workbook (.xlsb). If someone saved it as .xlsx, the code was stripped out at save time and cannot be recovered from that copy. Re-save from an original .xlsm file instead.
  6. Back up before you touch anything. Copy the .xlsm file to a separate folder with a dated name. Macro edits, conversions and re-saves are the point where people lose working code they cannot rewrite.
  7. Inventory what your macros actually do. Open the workbook, press Alt+F11 on Windows (on Mac, Tools > Macro > Visual Basic Editor) and read each module. Note whether each macro imports data, formats sheets, sends email, calls external files or connects to databases. Anything that touches files or the network is the hardest to migrate and the riskiest to keep running from untrusted sources.
  8. Test Office Scripts for the recordable cases. For formatting, sorting, filtering, copying between sheets and simple data cleanup, the Automate tab in Excel for Microsoft 365 (Windows, Mac and the web) offers Record Actions, which writes a TypeScript script as you click. Record the manual steps, then run the script to confirm the output matches what the macro produced.
  9. Handle scripts that need triggers or scheduling. Office Scripts can be run from the Automate tab, from Power Automate flows, or on a schedule through a flow. A script cannot be launched by opening the workbook the way an auto-open macro can, so plan the trigger separately: a flow that runs on a schedule, or on a file-created event in a SharePoint or OneDrive folder.
  10. Convert the remainder or accept it. Anything that relies on VBA-only features — custom UserForms, Windows API calls, complex event handlers, connections to desktop-only add-ins — has no automatic equivalent. Either keep those workbooks in a Trusted Location with macros enabled by notification and VBA retained, or pay for a manual rewrite. Do not attempt a half-conversion that leaves a spreadsheet depending on both systems.
  11. Retire the old macro files. Once a workbook is converted and verified, move the .xlsm original into an archive folder outside your working set, note what replaced it, and remove it from shared drives and email threads so colleagues stop circulating copies. Circulating macro attachments is how most organisations ended up with the warning-banner problem in the first place.

Common Mistakes

  • Turning on "Enable all macros" to make the banner go away. It fixes the symptom and opens the door to any malicious file that reaches the machine. Use Trusted Locations or per-file enabling instead.
  • Saving as .xlsx and wondering where the code went. .xlsx cannot store VBA; the code is discarded silently at save.
  • Unblocking a file someone emailed you without checking what it does. Unblock only files you created or received through a channel you trust, and read the code first.
  • Adding an entire shared drive as a Trusted Location. Anyone who can write to that share can then run code on your machine with no warning.
  • Assuming Office Scripts can do everything VBA did. They cannot open desktop dialogs, call Windows libraries or drive the older desktop add-ins.
  • Expecting Office Scripts to work in older perpetual Excel versions. They are a Microsoft 365 feature; a locally installed older copy will not show the Automate tab.

Tips

  • Keep one small test workbook with a harmless macro so you can check quickly whether a settings change worked.
  • Name Trusted Locations descriptively (for example "Work-Macros") so you can audit them later.
  • When recording a script, do one clean pass with no mistakes; the recorder captures every click, including mis-clicks.
  • Store converted workbooks in OneDrive or SharePoint — a local copy of an Office Scripts workbook will open without its scripts on another machine.
  • Comment your script right after recording, while the steps are still fresh.

Troubleshooting

  • The banner never appears and nothing runs. The file may be open in Protected View, or your organisation may enforce a policy. Close and reopen from a local folder, then ask IT whether macro execution is restricted by policy.
  • Enable Content is greyed out. The file is likely in a Trusted Location already, or a policy is blocking it. Check Trust Center settings before assuming corruption.
  • Macros run but produce errors. A dependency is missing — an add-in, a referenced library, or a file path that no longer exists. Read the error line in the editor rather than re-recording from scratch.
  • "Code execution has been interrupted." Press Debug on the message to see the failing line, or reset with the stop button in the editor and run again.
  • The Automate tab is missing. Office Scripts require a Microsoft 365 subscription and a file saved to OneDrive or SharePoint. A local .xlsx opened from a desktop folder will not show it.
  • A script fails after a file move. Re-record any step that referenced a path, since scripts address workbooks and folders by location.
  • Nothing above works. Restart Excel fully (close every window), then check for updates through your Microsoft 365 account, and as a last resort create a fresh profile or reinstall Office rather than editing the registry.

Frequently Asked Questions

Are VBA macros being removed from Excel?

No. VBA is still supported in Excel for Windows and Mac. Microsoft has changed the default handling of macros in files from untrusted sources, and promotes Office Scripts for new automation, but existing VBA continues to run when enabled.

Why did my macros stop working after an update?

Most often the file gained a Mark of the Web (a flag applied to downloaded or emailed files) and Excel now blocks it by default. Unblocking the file in its Properties, or placing it in a Trusted Location, restores it.

Can I use macros in Excel on the web?

VBA cannot run in Excel for the web. You can open a macro-enabled workbook, but the code will not execute. Use the desktop app for VBA, or Office Scripts, which do run in the browser.

Do Office Scripts replace every macro?

No. They cover common data and formatting tasks and can be triggered by Power Automate, but they cannot use VBA-only features such as UserForms or Windows library calls.

Will converting to Office Scripts break my colleagues' copies?

It can, if they rely on the macro in a local file. Convert one workbook at a time, keep the original archived, and tell people which file replaces it.

Is it safe to click Enable Content?

Only if you know where the file came from and what its code does. If either is unclear, do not enable it — open a copy in a sandboxed environment or ask the sender for a macro-free version.