How to Fix Excel VBA Macro Crashing on Mac But Working on Windows
Question details
A complex Excel macro workbook crashes on Mac with an EXC_BAD_ACCESS error but functions correctly on a Windows PC.

- Product
- Microsoft Excel
- Device & OS
- Mac (macOS)
- Scenario
- Running complex VBA macros or clicking specific macro-assigned buttons within a workbook on a Mac.
- Observed behavior
- Excel crashes unexpectedly, often returning an EXC_BAD_ACCESS error, preventing the user from generating results or utilizing the macro functions.
Ensure that your Mac is plugged in and save a backup copy of your macro-enabled workbook (.xlsm) before testing or modifying any VBA code.
Update macOS and Microsoft 365 to the Latest Versions
System and software updates often contain critical patches for EXC_BAD_ACCESS errors and macro execution bugs on Mac.
Many memory access errors (like EXC_BAD_ACCESS) are tied to specific bugs in the macOS environment or Office for Mac builds. Updating to macOS 12.2.1 or later and ensuring Microsoft 365 is fully updated often resolves baseline stability issues.
Click the Apple menu > System Settings (or System Preferences) > General > Software Update, and install any pending updates to reach version 12.2.1 or newer.
Open Microsoft Excel, click Help in the top menu bar, select Check for Updates, and install the latest available Microsoft 365 updates.
Restart your Mac, open the workbook, and test the specific buttons (e.g., 'Generate Results') on the INPUT or OUTPUT sheets to see if the crash persists.

Inspect VBA Code for Windows-Only Incompatibilities
Macros written on Windows often use ActiveX controls or Windows API calls that are not supported on Mac and will cause crashes.
Try WPS Office for a Seamless Spreadsheet Experience
If Microsoft Excel continues to crash on your Mac due to complex macro compatibility issues, consider switching to WPS Office. It is a highly compatible, lightweight, and free alternative that handles complex spreadsheets effortlessly without burdening your system.
- 1. Download and Install: Visit the official WPS website and download the free WPS Office suite for Mac.
- 2. Open Your Workbook: Launch WPS Spreadsheets and open your .xlsm or .xlsx file to view and edit your data seamlessly.
- 3. Enjoy High Compatibility: Experience high compatibility with Excel files and a familiar tabbed interface without the heavy resource usage of Microsoft Office.

Frequently Asked Questions
Why do Excel macros work on Windows but crash on Mac?
Excel for Mac operates in a 'sandboxed' environment and uses a different underlying architecture than Windows. Features like ActiveX controls, COM add-ins, and specific Windows API calls are not supported on macOS, causing macros relying on them to fail or crash.
What does the EXC_BAD_ACCESS error mean in Excel for Mac?
This error indicates that Excel attempted to access a memory block it shouldn't have or that the memory is corrupted. In the context of VBA, it usually happens when a macro tries to execute a Windows-specific command or component that is missing on Mac.
How do I make my Excel macros compatible with both Mac and Windows?
To ensure cross-platform compatibility, avoid using ActiveX controls and Windows-specific API calls. Instead, use standard Form Controls and Mac-compatible AppleScript equivalents where necessary, or use conditional compilation (#If Mac Then ... #Else ... #End If) in your VBA code.
Can I run Windows Excel on my Mac to avoid these macro crashes?
Yes, if a workbook strictly requires Windows-only VBA features, you can run the Windows version of Excel on your Mac using virtualization software like Parallels Desktop, VMware Fusion, or by booting into Windows via Boot Camp.




