Software⏱️ 3 min read📅 2026-06-15

How to Fix: Constant compile error after 64 bit Office upgrade

Constant compile error after 64 bit Office upgrade

Quick Answer: Update VBA code to use PtrSafe attribute and review Declare statements.

Constant compile errors in Excel after upgrading to 64-bit Office can be frustrating and hinder productivity. This issue affects users who have recently updated their MS Office to 64-bit versions using the Microsoft Updater.

The constant appearance of this error message, even when starting Excel without opening a file or entering data, makes it challenging to perform tasks in Excel.

💡 Why You Are Getting This Error

  • The primary cause of this issue is that the VBA (Visual Basic for Applications) code in the 64-bit version of Office is not compatible with the new 64-bit architecture. This requires updates to Declare statements and marking them with the PtrSafe attribute.
  • Another possible reason is that there might be a conflict between the 64-bit version of Excel and other software or system components on your Mac, which could be causing this error.

🛠️ Step-by-Step Verified Fixes

Updating VBA Code

  1. Step 1: Open Excel and go to Developer > Visual Basic. In the Visual Basic Editor, navigate to Tools > References. Check if 'Microsoft Visual Basic for Applications x.x Library' is listed; if not, check box next to it.
  2. Step 2: In the Visual Basic Editor, search for 'Declare' in the Find What field and press Enter. Update any outdated Declare statements with the PtrSafe attribute.
  3. Step 3: Save your changes and close the Visual Basic Editor. Restart Excel or try opening a new file to test if the issue persists.

Disabling VBA Macro Execution

  1. Step 1: Open Excel and go to Developer > Macros. In the Macro dialog box, uncheck the box next to 'Enable content' and click OK.
  2. Step 2: Try opening a new file or entering data in Excel without enabling macro execution to see if the issue resolves itself.

🎯 Final Words

To resolve the constant compile error after upgrading to 64-bit Office, try updating VBA code by checking Declare statements and marking them with the PtrSafe attribute. If this doesn't work, you can disable VBA macro execution to temporarily bypass the issue.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions