FormulaSurge
All articles

excel-errors

Excel Macros Stopped Working After an Update

VBA macros broke after a Microsoft 365, Office or Windows update? Match the error message to one of six causes, from blocked files to 64-bit PtrSafe, and fix it.

  • vba
  • macros
  • office update
  • ptrsafe
  • excel errors
3 min readBy
Excel Macros Stopped Working After an Update

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 saysLikely cause
Microsoft has blocked macros from running because the source of this file is untrustedBlocked file (Mark of the Web)
Security warning: Macros have been disabledMacro settings reset
Compile error: Can't find project or libraryMISSING reference
Compile error: The code in this project must be updated for use on 64-bit systems64-bit Declare statements
Run-time error '429': ActiveX component can't create objectLibrary or app not available
Run-time error '1004' on a line that worked last weekChanged 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 If

5. 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.

FS

Written by

Independent Excel practice · 10+ years of hands-on Excel work

Excel specialists in Power Query, Power Pivot, VBA and financial modeling. The patterns on this page are the same patterns we build with - fixed scope, fixed price, named owner. About FormulaSurge. Stuck on a formula? Get a free fix.

Free tool · 1 min · runs in your browser

Hours Saved Calculator

Calculate your annual recoverable time and cost savings from automating manual Excel reporting.

Open the tool

Related service

Need this built for your team?

See Excel Automation - fixed price in writing, built end-to-end. Not sure of the scope? A Scoping Sprint ($99 / ₹4,999) gives you an exact quote first.

Read more

Start here · Scoping Sprint

Know the exact price in 2 working days. $99, credited in full to your build.

Builds from $75, fixed in writing · Working draft in 5 days or your first payment back · Mutual NDA first if you want one

See a sample Sprint report →Who you'll work with: two partners, 10+ years on finance workbooks →

10+ years in ExcelNamed senior ownerFixed price, in writingDraft in 5 days or refundMutual NDA on request30-day warranty

Frequently asked

Questions readers ask most.

Why do macros stop working after an update?

Usually one of six things: Windows marked the file as downloaded and Office blocks its macros, macro settings were reset, a library the code uses changed version, the update switched Office from 32-bit to 64-bit, a control or feature the macro relies on was disabled, or the new build has a bug that affects one method.

What does "Microsoft has blocked macros from running because the source of this file is untrusted" mean?

The file carries a Mark of the Web: Windows recorded that it came from the internet or an email attachment, so Office turns its macros off. Unblock the file in its Properties, or keep macro files in a trusted location. It is a security setting, not a problem with your code.

How do I fix "The code in this project must be updated for use on 64-bit systems"?

Add the PtrSafe keyword to each Declare statement and change any handle or pointer arguments from Long to LongPtr. Wrap old and new versions in #If VBA7 if the file also has to run on old 32-bit Office.

What does "Can't find project or library" mean?

A reference in Tools > References points at a library that is not on this computer, often an older version of Outlook, Word or a third-party add-in. Untick the MISSING one and tick the version that is installed, or switch the code to late binding with CreateObject so it does not depend on a version.

Should I roll back Office?

Only as a short-term workaround, on one machine, after you have confirmed the build is the cause. Rolling back also removes security fixes, so plan the code fix or wait for the corrected build rather than staying on the old one.

Start with a Scoping Sprint

Want this built for your team?

Send your requirements, a sample workbook or a screenshot. We reply within one working day, and the Scoping Sprint ($99 / ₹4,999) gives you the exact price in 2 working days, credited in full to the build.

  • Written scope and fixed price before any build work starts
  • Working draft in 5 working days or your first payment back
  • Recorded walkthrough and 30-day warranty at handover
  • Mutual NDA on request
Replies within one working day, usually the same day

Calls 9am–7pm IST, Mon–Sat · How a project works

Built for teams in

Industries and cities this work is set up for

How we work

Six rules every FormulaSurge project runs on.

Not slogans. Operating rules - the same six on every dashboard, audit, macro and model.

15% OFF

15% off your first project

Start with the $99 Scoping Sprint - credited in full to your build.

View more

15% off the build fee of your first project. Mention it when you book; the Scoping Sprint is still credited in full.

The Scoping Sprint gives you a written diagnosis and a fixed price for your build in 2 working days.

Not ready yet? · Free

Free 10-minute Excel audit

Seven checks on your workbook, results in writing within one working day.