Office for Mac Issues

How to Fix VBA Macros Not Working in Excel for Mac

Huda QurayshiHuda Qurayshi Nov 11, 2026 869 views

Question details

The user needs to troubleshoot and fix VBA macros that fail to execute or produce runtime errors when run in Microsoft Excel on macOS.

How to Fix VBA Macros Not Working in Excel for Mac
Product
Microsoft Excel for Mac
Device & OS
macOS
Scenario
Attempting to run a VBA macro in an Excel workbook on a Mac, particularly when the file was originally created on a Windows PC.
Observed behavior
The macro fails to execute, either due to disabled macro security settings, unsupported ActiveX controls, or incompatible Windows-only APIs and file paths.
Before you start

Ensure you have saved a backup copy of your original macro-enabled workbook before making any code modifications. Also, verify that the file extension is correctly set to .xlsm, as standard .xlsx files will not execute or save VBA code.

Solution 1Recommended

Enable Macro Security Permissions and Check File Settings

Start by ensuring that Excel for Mac is allowed to run macros and that the file is saved in the correct format.

1
Enable macros in Excel Preferences

Open Excel, click on 'Excel' in the top menu bar, and select 'Preferences'. Navigate to 'Security' and temporarily select 'Enable all macros' to test if the issue is related to restricted permissions.

2
Check the file format

Ensure your file is saved as an Excel Macro-Enabled Workbook (.xlsm). If it is saved as a standard .xlsx file, the macro code will be disabled and stripped upon saving.

3
Unblock downloaded files

If you received the file via email or downloaded it from the internet, locate the file in Finder. Right-click, select 'Get Info', and verify that the file is not blocked or locked by macOS security settings.

Enable Macro Security Permissions and Check File Settings
Security Warning: Only enable all macros for files you completely trust. Once testing is complete, it is highly recommended to revert your security settings to 'Disable all macros with notification' to protect your Mac.
Free Microsoft Office alternative

Looking for a smoother spreadsheet experience on Mac? Try WPS Office

If you are tired of dealing with complex macro errors and compatibility issues in Microsoft Excel for Mac, WPS Office offers a free, lightweight, and highly compatible alternative. It provides a familiar, easy-to-use interface to manage all your daily spreadsheet tasks without the hassle.

  1. 1. Download the Installer: Visit the official WPS Office website and download the free macOS installer.
  2. 2. Install WPS Office: Open the downloaded package and follow the simple on-screen instructions to install the application.
  3. 3. Open Your Spreadsheets: Launch WPS Office and directly open your existing Excel files to experience seamless compatibility.
Fully compatible with Microsoft Excel (.xlsx, .xlsm, .xls) formats.Lightweight installation that runs incredibly smoothly on macOS.Familiar tabbed user interface, requiring zero learning curve to switch.Built-in PDF editing, word processing, and presentation tools in one unified app.
microsoft office alternative - wps office

Frequently Asked Questions

Why do my Excel macros work perfectly on Windows but fail on Mac?

Excel for Mac operates in a 'sandboxed' environment for security reasons, meaning it cannot access system-level files the same way Windows can. Additionally, Windows-specific features like ActiveX controls, scripting dictionaries, and certain API calls simply do not exist on macOS.

How do I open the VBA editor in Excel for Mac?

You can open the VBA editor on a Mac by pressing Option + F11 or Command + Option + F11. Alternatively, you can enable the Developer tab by going to Excel > Preferences > Ribbon & Toolbar, checking the Developer box, and then clicking the 'Visual Basic' button on the ribbon.

Can I use ActiveX controls in Excel for Mac?

No, ActiveX controls are a proprietary Windows technology and are entirely unsupported on macOS. If your workbook relies on ActiveX buttons or dropdowns, you will need to replace them with standard Form Controls, which work properly on both operating systems.

What does the 'Macros are disabled' warning mean when I open a file on Mac?

This is a built-in macOS and Excel security feature designed to prevent potentially malicious code from running automatically. To fix this, click 'Enable Macros' when prompted upon opening a trusted file, or adjust your macro security permissions in Excel Preferences.