If you have ever opened a spreadsheet only to discover your macros excel not working as expected, you are not alone. Millions of users hit this wall every week, and the causes range from a single checkbox in the Trust Center to a corrupted VBA reference deep inside the project. Excel macros are powerful, but they are also fragile, and even a minor Microsoft update can silently disable automation you have relied on for years. This guide will walk you through every common cause and the exact fix for each.
Macros stop working for predictable reasons, and once you understand the categories of failure, troubleshooting becomes systematic rather than frustrating. The most common culprits are security settings introduced after the 2022 Mark of the Web policy change, broken file paths, missing references, antivirus interference, and conflicts with newer Excel features like Dynamic Arrays. We will cover each one with screenshots-in-words so you can follow along on your own machine without guessing.
Before you dive in, it helps to know whether your macro ever worked. A macro that suddenly stopped almost always points to a security policy change, an Office update, or a moved file. A macro that has never worked usually means a coding error, a missing library reference, or that macros are simply disabled at the policy level. We will treat these two scenarios separately because the fixes are very different.
This article is written for US users running Microsoft 365, Excel 2021, Excel 2019, and Excel 2016 on Windows. Mac users will find the underlying logic identical, though the menu paths differ slightly. We will note Mac-specific differences where they matter. If you also work with formulas alongside macros, you may want to bookmark our deeper reference on functions used inside VBA loops and event handlers.
Beyond the technical fixes, this guide includes a defensive checklist so your macros keep working after the next Office update lands. Microsoft now ships security changes more aggressively than in past decades, and what worked in March can break in April without warning. We will show you how to sign your macros, store them in trusted locations, and structure your VBA to survive these rolling changes.
If you are preparing for an Excel certification or job interview, expect macro troubleshooting questions on every modern test. Knowing why a macro fails is now as important as knowing how to write one. We will weave in practice opportunities throughout this article so you can pressure-test your knowledge as you go. Let us start with the big picture, then drill into the specific fixes one layer at a time.
One last note before we begin: always back up your workbook before you start editing macro security settings or modifying VBA modules. A surprising number of recovery situations begin with a well-meaning user clicking the wrong reset button and losing months of automation. Save a copy with a timestamp in the filename, then proceed with confidence.
Macro settings under File > Options > Trust Center disable VBA by default in Microsoft 365. This is the single most common reason macros stop running, especially after a clean install or major update.
Files downloaded from email, web, or network shares carry a hidden flag that Excel uses to block macros entirely, regardless of your security settings. Even safe files get blocked under this 2022 policy.
VBA projects reference external libraries like Outlook, Word, or ADO. When those library versions change after an Office update, your macro fails on the first line that uses them with a compile error.
Macros only run inside .xlsm, .xlsb, or .xlam files. Saving as .xlsx silently strips every macro. Many users discover this only after closing and reopening the file.
Enterprise security tools like CrowdStrike, Defender for Endpoint, and SentinelOne now scan VBA in real time. A false positive can suspend macro execution mid-run without any visible error message.
The Trust Center is where you will spend most of your troubleshooting time when macros excel not working becomes your daily reality. To open it, click File, then Options, then Trust Center, then the Trust Center Settings button. Inside, select Macro Settings. You will see four radio buttons ranging from Disable All Macros Without Notification to Enable VBA Macros. The recommended setting for users who run their own macros is Disable VBA Macros With Notification, which lets you approve macros file by file rather than blanket-enabling everything.
Below the radio buttons is a checkbox labeled Trust Access to the VBA Project Object Model. If your macro programmatically modifies other macros, references the VBE, or uses certain add-in installation routines, this box must be checked. Many automation frameworks fail silently when it is unchecked because Excel suppresses the underlying error to prevent privilege escalation attacks. Tick it only if you trust every workbook you open, since malicious macros can use it to rewrite other code.
Trusted Locations is the second pillar of macro security and the cleanest way to enable specific macros without weakening your global settings. Add a folder like C:\Users\YourName\Documents\TrustedMacros, and every file inside it will run without prompting. This approach is widely recommended by IT teams because it gives users productivity while limiting the blast radius if a malicious file lands in a normal downloads folder. Always uncheck Allow Trusted Locations on My Network unless you absolutely need shared paths.
Trusted Publishers is the third pillar and the most professional solution. If you create macros for your team, generate a self-signed certificate using SelfCert.exe from your Office install folder, sign your VBA project once, then have each user add your certificate to their Trusted Publishers list. After that, your signed macros run on every machine without any prompts, and any unsigned tampering invalidates the signature and re-engages the security warning. This setup takes thirty minutes once and saves years of support tickets.
Group Policy can override everything you do in the Trust Center, and this catches many enterprise users by surprise. If your IT team has pushed a policy that disables macros, your local settings will appear correct but macros will still refuse to run. Open the Registry Editor and look under HKEY_CURRENT_USER\Software\Policies\Microsoft\Office\16.0\Excel\Security for any keys named VBAWarnings or BlockContentExecutionFromInternet. If you see them, escalate to your IT team rather than editing the registry yourself.
Personal macro workbook problems deserve their own paragraph because they generate confusing symptoms. The Personal.xlsb file lives in your XLSTART folder and holds macros you want available across every workbook. If it becomes corrupted or moves, your global macros vanish without warning. Navigate to %appdata%\Microsoft\Excel\XLSTART, confirm Personal.xlsb exists, and if not, record a one-line dummy macro through View > Macros > Record Macro and select Personal Macro Workbook as the destination. Excel will recreate the file automatically.
Finally, double-check that you are opening the right file. Excel maintains separate recent-file lists for different windows, and Windows Explorer sometimes opens files with the protected view sandbox even after you have enabled editing. Look at the title bar. If you see [Protected View] or [Read-Only], macros are intentionally suppressed and no Trust Center setting will change that. Click Enable Editing, save the file to a Trusted Location, then close and reopen it cleanly. For broader formula automation that complements macros, our complete reference on Excel functions for finance workflows is a useful companion.
Prepare for the Microsoft Excel exam with our free practice test modules. Each quiz covers key topics to help you pass on your first try.
Open the VBA editor with Alt+F11, then go to Tools > References. Any reference marked MISSING in the list is the immediate cause of a compile failure. This usually happens when a workbook moves between machines with different Office versions or when an add-in is uninstalled. Uncheck the missing reference, find the equivalent current library in the list, and check it instead. Save the file as .xlsm and reopen.
Common offenders include the Microsoft Outlook Object Library, Microsoft Word Object Library, and various ADO and DAO data access libraries. If your macro automates Outlook, the reference version number changes with every Office update, so build resilient code using late binding via CreateObject instead of early binding through the References list. Late binding sacrifices IntelliSense but survives every future update without manual intervention.
Press Ctrl+G in the VBA editor to open the Immediate window, then run Debug > Compile VBAProject from the menu. This forces Excel to validate every line of every module without actually executing anything. Compile errors show you the first broken line, but be aware that fixing it may reveal more underneath. Work through them one by one, saving after each fix so you do not lose progress to a crash.
The most common compile error in 2026 is Method or Data Member Not Found, which usually means a property name changed between Excel versions or that you are referencing a control on a UserForm that no longer exists. Compile errors freeze your entire macro project, so even unrelated macros stop running until the offending line is resolved. Never ship a workbook without compiling it cleanly first.
Runtime errors happen mid-execution and usually point to data conditions your code did not anticipate. Error 1004 is the catchall for Excel objects refusing a command, often because a sheet name changed or a range is empty. Error 9 means subscript out of range, typically a missing worksheet. Error 91 means an object variable is not set, usually a Find or Match that returned Nothing.
Build defensive code by checking for Nothing before using Find results, validating that worksheets exist by name before referencing them, and wrapping risky blocks in On Error Resume Next paired with explicit Err.Number checks. Never leave On Error Resume Next on globally, as it hides bugs that will surface in production at the worst possible moment. Reset error handling at the end of every routine.
Buried near the bottom of the Macro Settings page is a checkbox labeled Block macros from running in Office files from the Internet. This is the Mark of the Web enforcement toggle introduced in 2022. Even with macros otherwise enabled, this checkbox will silently kill any file you downloaded, received by email, or opened from a network drive. Unchecking it is the single fastest fix when macros worked yesterday and stopped today.
The Mark of the Web, abbreviated MOTW, is the most disruptive change Microsoft has made to macro security in two decades. When you download a file from a browser, receive it as an email attachment, or copy it from a network share, Windows attaches an Alternate Data Stream named Zone.Identifier with a value indicating the file came from an untrusted zone. Excel reads that stream when opening the file and disables macros entirely, regardless of your other settings. This is why a workbook that runs perfectly on your colleague's machine fails the moment you email it to yourself.
To remove the Mark of the Web manually, right-click the file in File Explorer, choose Properties, and look at the bottom of the General tab. If you see a Security section with the message This file came from another computer and might be blocked, check the Unblock box and click OK. The file will now run macros normally. You can also remove the MOTW from many files at once using PowerShell: Get-ChildItem -Path C:\YourFolder -Recurse | Unblock-File. Both methods strip only the security stream, not the file content itself.
For email attachments specifically, save them to a Trusted Location before opening rather than double-clicking from Outlook. The act of saving to a trusted folder breaks the chain of custody that triggers MOTW enforcement on some Office versions. This approach is the official Microsoft recommendation for enterprise users who must work with macro-enabled attachments daily without weakening their global security posture or asking IT to push registry exceptions.
Network shares introduce another layer of complication because the MOTW can be applied to files based on the share's UNC path rather than the file's origin. If your team stores macros on a shared drive, ask IT to add that drive's path to the Local Intranet zone in Internet Options. Files opened from the Local Intranet zone are exempt from MOTW enforcement by default. This single change saves countless support tickets in organizations that rely on shared automation.
The Block macros from running in Office files from the Internet policy can be controlled at the Group Policy level, which is how most enterprises manage it. Your IT team can create exceptions for specific file paths, signed publishers, or trusted domains without requiring users to manage their own MOTW removal. If you are an end user fighting MOTW repeatedly, escalate to IT rather than building workarounds, because manual MOTW removal is increasingly logged and reviewed as a security event.
Cloud storage adds its own twist. Files synced from OneDrive, SharePoint, Google Drive, and Dropbox sometimes inherit MOTW based on how the sync client writes them to disk. OneDrive Files On-Demand in particular has historically attached MOTW to placeholder files. The fix is to right-click the file, select Always Keep On This Device, wait for it to fully sync, then unblock the local copy. Once unblocked, macros run normally even when the file is accessed via the cloud path.
Finally, be aware that MOTW resets when files are zipped and unzipped, emailed, or moved between drives. A file you unblocked yesterday can be blocked again tomorrow if it touches an untrusted boundary. The only durable solution is to digitally sign your VBA project and have users trust your publisher certificate. Signed macros run regardless of MOTW status because trust is established by the signature rather than the file origin. This is how every professional VBA developer ships production automation in 2026.
Prevention beats troubleshooting, and a few habits will keep your macros excel not working incidents to a minimum going forward. Store every macro-enabled file in a Trusted Location from day one. Never download macro files directly to your Desktop or Downloads folder, since these are outside the trust boundary and require MOTW removal every time. Build a simple workflow: download to Downloads, immediately move to Trusted, then open. This habit alone eliminates ninety percent of MOTW-related failures.
Sign your VBA projects, even for personal use. SelfCert.exe is free, takes two minutes to run, and produces a certificate that you can install once on every machine you use. Signed projects survive Office updates, MOTW, and most enterprise policies without intervention. The exception is signed projects whose code has been modified after signing, which invalidates the signature and re-triggers security prompts. Always re-sign after editing, and treat the signing step as part of your release process.
Use late binding for external libraries whenever possible. Instead of writing Dim ol As Outlook.Application and adding the Outlook reference, write Dim ol As Object followed by Set ol = CreateObject("Outlook.Application"). You lose IntelliSense during development but gain immunity to reference version changes. This pattern has saved more macro projects than any other single technique, and it is now the default in every modern VBA tutorial published by Microsoft itself.
Keep a clean separation between code and data. Store your macros in a single .xlam add-in file installed centrally, then have user workbooks call into the add-in. When a macro needs updating, you replace the add-in once and every user gets the new code immediately. This approach also makes signing trivial because you sign one file rather than dozens. For pure formula work that complements your macros, see our reference on importing TXT and CSV files into spreadsheets without manual cleanup.
Document every macro with a comment header that includes the author, creation date, last modified date, and a short description of what the macro does. Future you, six months from now, will not remember why a particular routine exists, and the first thing you should do when a macro fails is read the header to understand its original intent. This habit also helps when handing off automation to colleagues or auditors who need to verify what the code touches.
Test your macros against the Insider Beta channel of Microsoft 365 if you can spare one machine for it. The Beta channel previews changes one to three months before they reach the general public, giving you advance warning when a future update will break your automation. Many enterprises run a small fleet of Beta machines specifically for this purpose, and even individual power users benefit from the heads-up time it provides on macro compatibility issues.
Maintain a recovery copy of every workbook in a separate folder, ideally with a date stamp in the filename. If a macro breaks catastrophically, you can roll back to last week's version while you diagnose what changed. Combine this with Excel's built-in AutoRecover feature, which you can set under File > Options > Save to checkpoint every five minutes. Together, these two habits make macro disasters survivable rather than career-ending.
When everything else fails, there are a few advanced techniques that recover macros from seemingly hopeless situations. The first is the VBA project password reset. If you inherited a workbook with a locked VBA project and the original author is unreachable, you can sometimes recover access by opening the file in 7-Zip, navigating to the xl folder, extracting vbaProject.bin, and editing the binary with a hex editor to clear the password bytes. This is delicate work that can corrupt the file, so always work on a copy.
Workbook corruption causes some of the most frustrating macro failures because the symptoms look like coding bugs. If a macro runs fine in a new blank workbook but fails in the production file, suspect corruption. Open the file, then save as Excel Binary Workbook (.xlsb). The binary format rebuilds internal structures and often clears latent corruption. If that fails, try opening the file with the Open and Repair option from the File > Open dialog, then accept the extract data option to recover what Excel can rescue.
The CleanUp utility, also known as Code Cleaner, exports every VBA module to text files, deletes the original modules, then re-imports the text files. This forces Excel to rebuild every module from scratch, clearing internal compilation state that can become corrupted over time. The official tool is called VBA Code Cleaner by Stephen Bullen, and it remains the gold standard for resolving mysterious VBA misbehavior that survives every other fix. Run it monthly on heavily-used workbooks as preventive maintenance.
Conflicts between macros and modern Excel features cause an emerging class of failures. Dynamic Array formulas, LET, LAMBDA, and Power Query refreshes can all interact unpredictably with macros that worked perfectly in older versions. If your macro manipulates ranges that now contain spilled arrays, you may get Error 1004 when Excel refuses to overwrite a spill. Use the @ implicit intersection operator in your formula references, or add explicit checks for spilled ranges before assignment in your VBA.
Threading and asynchronous operations create subtle macro failures that did not exist a decade ago. If your macro calls Application.OnTime, fires a Workbook_Open event, and triggers a Power Query refresh in parallel, you can end up with race conditions where the macro tries to read data before the query finishes. Add explicit DoEvents calls or Application.CalculateUntilAsyncQueriesDone to serialize operations. This is one of the fastest-growing categories of macro failure reports in 2026.
For teams that depend heavily on macros, invest in a code repository. Store every VBA module as a separate text file in a Git repository, with one commit per change. Use the VBA-Sync add-in or your own export routine to keep the text files synchronized with the workbook. When a macro breaks, you can compare today's code to yesterday's commit and find the exact line that changed. This is how professional shops manage VBA in 2026, and it transforms macro maintenance from black art to engineering discipline.
Finally, know when to give up on VBA and rewrite in Office Scripts or Python in Excel. Office Scripts runs in the cloud, integrates with Power Automate, and survives every Microsoft update by design. Python in Excel, introduced in 2024, handles data analysis tasks more cleanly than VBA ever could. For new automation, default to one of these modern platforms. Keep VBA for legacy maintenance only, and your future macro-not-working incidents will dwindle to nothing.