How to Fix Locked VBA Project in Excel for Mac
Question details
The user is unable to view or edit a VBA project because it is locked, and the option to insert a new module is grayed out.

- Product
- Excel for Microsoft 365
- Device & OS
- Mac
- Scenario
- Attempting to access the VBA editor, write macros, or insert a new VBA module in an Excel workbook.
- Observed behavior
- The VBA project is completely locked, the 'Insert Module' command is unavailable, and background add-ins may unexpectedly prompt for an unknown password.
Ensure you are opening a trusted workbook, as enabling macros and modifying VBA trust settings can expose your computer to malicious scripts.
Enable Macros and Trust VBA Object Model
Adjusting Excel's security preferences to explicitly trust the VBA project object model is the primary fix for locked projects.
By default, Excel for Mac restricts access to the VBA object model to prevent unauthorized code execution. Enabling this trust setting restores full functionality to the VBA editor.
Launch Excel on your Mac. Click on 'Excel' in the top Apple menu bar, then select 'Preferences'.
In the Preferences window, locate and click on 'Security & Privacy'.
Select the option to 'Enable all macros' and explicitly check the box for 'Trust access to the VBA project object model'.
Close the Preferences window and quit Excel completely. Reopen the application and test if you can access the VBA project.
Save as a Macro-Enabled Workbook (.xlsm)
Excel restricts macro editing if the active file is saved in a format that does not support VBA code.
Disable Unrecognized Add-ins
Third-party add-ins (such as Adobe PDF tools) can cause software conflicts that lock the VBA project or prompt for strange passwords.
Try WPS Office for a Seamless Spreadsheet Experience
If you are constantly struggling with macro errors, locked VBA projects, or frustrating add-in conflicts in Excel for Mac, WPS Office provides a stable, lightweight, and highly capable alternative.
- 1. Download WPS Office: Visit the official WPS Office website to download the free installation package.
- 2. Install the App: Run the installer and follow the simple on-screen instructions.
- 3. Open Your Spreadsheets: Launch WPS Spreadsheets to seamlessly view, edit, and analyze your existing Excel files.

Frequently Asked Questions
Why is the 'Insert Module' command grayed out in Excel for Mac?
This happens when your workbook is not saved in a macro-compatible format, or when Excel's security preferences are set to block access to the VBA project object model.
Why does Excel ask for a password for an add-in I didn't create?
Some third-party software, like Adobe Acrobat, installs background add-ins in Excel. These developers lock their add-in code with passwords. If Excel tries to compile or interact with it incorrectly, it will prompt you for the developer's password. Disabling the add-in resolves this.
Do I need to reinstall Office to fix a locked VBA project?
Reinstalling Office should only be used as a last resort. Most locked VBA project issues can be solved simply by trusting the VBA object model in your Security & Privacy settings or saving the file as an .xlsm.




