A macro that ran for years fails the morning after an update. It is rarely the code that changed. Something around it did: a security setting, a library version, Office going 64-bit, or the new build itself. The error message tells you which, so start there.
Match the message to the cause
| What Excel says | Likely cause |
|---|---|
| Microsoft has blocked macros from running because the source of this file is untrusted | Blocked file (Mark of the Web) |
| Security warning: Macros have been disabled | Macro settings reset |
| Compile error: Can't find project or library | MISSING reference |
| Compile error: The code in this project must be updated for use on 64-bit systems | 64-bit Declare statements |
| Run-time error '429': ActiveX component can't create object | Library or app not available |
| Run-time error '1004' on a line that worked last week | Changed method or build regression |
The six causes and their fixes
1. The file is blocked (Mark of the Web)
Files from email or the internet carry a hidden mark, and Office blocks their macros by default. Right-click the file > Properties > tick Unblock. For a shared team folder, add it as a trusted location instead of unblocking files one by one.
2. Macro settings were reset
File > Options > Trust Center > Trust Center Settings > Macro Settings. In a company, these are often set by policy, so a change may need IT. Do not switch to "Enable all macros"; use a trusted location or a signed macro.
3. A reference is MISSING
Alt+F11, then Tools > References. A line marked MISSING stops the whole project from compiling, so even unrelated macros fail. Tick the installed version of the library, or changeDim app As Outlook.Application to Dim app As Object with CreateObject("Outlook.Application") so the code works with any version.
4. Office is now 64-bit
Windows API calls written for 32-bit Office will not compile. Add PtrSafe to eachDeclare and use LongPtr for handles and pointers:
#If VBA7 Then
Declare PtrSafe Function GetTickCount Lib "kernel32" () As Long
#Else
Declare Function GetTickCount Lib "kernel32" () As Long
#End If5. A control or feature was switched off
Recent builds restrict older ActiveX controls and some legacy features. If a button or form control stops responding, replace it with a Form control or a shape that runs the macro.
6. The build itself has a bug
In 2026, users on Microsoft Q&A reported that Version 2604 broke VBA that drives Outlook and pivot-table refreshes from VBA, and that going back to 2603 brought them back. If your macro broke on a specific date with no other change, compare your build number with Microsoft's release notes before rewriting the code.
Stop it happening next time
- Keep a list of the macros the business relies on and test them on a pilot machine when a new build arrives.
- Use late binding for Outlook, Word and other apps, so version changes do not break references.
- Put error handling in each macro that logs the build number and the line that failed.
Want it fixed for you?
If the business depends on the macro and nobody who wrote it is around, see VBA and macro maintenance: we diagnose it, fix it and document it, at a fixed price. Some old macros are better replaced: our Power Query vs VBA guide helps you decide. All error guides are in the Excel error library.