Fix Excel Password-Protected Macro Files Opening as Read-Only
Question details
A user's password-protected Excel macro files are opening in read-only mode and blocking macros instead of prompting for a password upon opening.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Opening a password-protected macro-enabled workbook (.xlsm) that may have been downloaded from the internet or shared over a network.
- Observed behavior
- The file opens automatically as read-only and bypasses the initial password prompt. When the user attempts to enable macros, Excel blocks the macros entirely as unsafe content.
Ensure you know the source of the macro-enabled file and verify that it is secure and trustworthy before adjusting your Trust Center settings or enabling blocked content.
Add the File Folder to Excel's Trusted Locations
Adding the file's directory to Excel's Trusted Locations bypasses security blocks on specific folders, allowing safe macros to run and triggering the password prompt normally.
Microsoft Excel employs strict security measures for files containing VBA macros. By designating a specific folder as a Trusted Location, Excel will treat all files within that folder as safe, preventing the software from forcing the file into read-only mode and blocking the macros.
Open Microsoft Excel, click on 'File' in the top left corner, and select 'Options' at the bottom of the menu.
In the Excel Options window, navigate to 'Trust Center' on the left sidebar, then click the 'Trust Center Settings' button.
Select 'Trusted Locations' from the left menu and click the 'Add new location...' button at the bottom.
Click 'Browse' to locate the folder containing your password-protected macro file. Check the box for 'Subfolders of this location are also trusted' if necessary, then click 'OK' on all dialog boxes to apply the changes.

Unblock Files Downloaded from the Internet
Removes the Mark of the Web (MOTW) attribute that causes Windows and Excel to automatically block macros and restrict files downloaded from external sources.
Contact Your Microsoft 365 Administrator
Necessary when organizational Group Policies are enforcing strict macro security settings that prevent individual users from bypassing read-only modes.
Use WPS Office to Easily Open and Edit Macro-Enabled Spreadsheets
If Microsoft Excel's strict security policies and macro blocks disrupt your daily workflow, consider using WPS Office. It provides a lightweight, highly compatible alternative with robust support for VBA macros and complex spreadsheets, completely free of charge.
- 1. Install WPS Office: Download and install the free WPS Office suite from the official WPS website.
- 2. Open Your Spreadsheet: Launch WPS Spreadsheets, click 'Open', and navigate to your password-protected macro file.
- 3. Enter Password and Edit: Input the document's password when prompted. The file will open smoothly, allowing you to run your macros and edit your data right away.

Frequently Asked Questions
Why does Excel block macros in my downloaded files automatically?
Microsoft recently updated Excel's default security settings to automatically block VBA macros in files originating from the internet. This feature uses the 'Mark of the Web' tag to prevent malware and ransomware attacks from executing automatically upon opening a workbook.
Can I disable the read-only mode for my Excel macro file without changing Trust Center settings?
If the file was downloaded, you can often disable the read-only mode by right-clicking the file in File Explorer, choosing Properties, and checking the 'Unblock' box. However, if the file is on a network drive, adding a Trusted Location is typically required.
What if I cannot click on 'Add new location' in the Trust Center?
If the 'Add new location' button is greyed out or missing, it means your organization's IT department manages these settings via Group Policy. You must contact your Microsoft 365 administrator to request that the network path be added to the organization's trusted locations.
Are password-protected Excel files more likely to be blocked?
Password-protected files can sometimes trigger different security behaviors because antivirus scanners cannot inspect their contents before Excel opens them. Consequently, Excel may enforce stricter default blocks (like read-only mode without a prompt) until the file location is explicitly trusted.




