VBA & Macro Problems

How to Fix Excel Macro Blocking on Trusted Network Drives

Natalie TaylorNatalie Taylor Oct 26, 2026 868 views

Question details

The user needs to unblock macros in macro-enabled Excel files stored on a network drive, as security warnings persist despite modifying Trust Center settings.

How to Fix Excel Macro Blocking on Trusted Network Drives
Product
Microsoft Excel
Device & OS
not provided
Scenario
Accessing and running macro-enabled Excel files stored on a shared network drive.
Observed behavior
Excel continues to block macros and displays a security warning because the network path is treated as an internet location, often due to the use of an IP address instead of a hostname.
Before you start

Ensure you know the exact server hostname for your network drive rather than its IP address, and verify that you have administrative access if Microsoft 365 tenant policies need to be adjusted.

Solution 1Recommended

Use Server Hostname for Trusted Network Locations

Configure Excel to trust the network location using the server's hostname rather than its IP address, as Microsoft Office security blocks IP-based paths.

By default, Microsoft Office blocks macros from files it identifies as coming from the internet. If you use an IP address to map your network drive, Excel treats it as an untrusted internet zone. Using the server hostname resolves this issue.

1
Open Trust Center Settings

Launch Microsoft Excel, click on 'File' in the top-left corner, select 'Options' at the bottom, and then click on 'Trust Center'. Click the 'Trust Center Settings' button.

2
Enable Network Trusted Locations

In the left-hand menu, select 'Trusted Locations'. At the bottom of this window, check the box that says 'Allow Trusted Locations on my network (not recommended)'.

3
Add the Hostname Path

Click 'Add new location'. In the Path field, enter the network path using the server hostname (e.g., \\ServerName\SharedFolder) instead of the IP address (e.g., \\192.168.1.50\SharedFolder).

4
Apply and Restart

Check 'Subfolders of this location are also trusted' if your Excel files are stored inside nested folders. Click 'OK' on all windows to apply the changes, then restart Excel.

Use Server Hostname for Trusted Network Locations
Security Warning Resolved: Once the hostname is properly added and network locations are permitted, the macro-enabled workbook should open without the red security block.
Free Microsoft Office alternative

Try WPS Office for a Hassle-Free Macro Experience

If you are struggling with strict internet macro blocking policies in Microsoft 365, consider switching to WPS Office. It provides powerful VBA support for your macro-enabled spreadsheets without the overly complicated security policy setups, making it easier to work securely on a local network.

Seamlessly open, edit, and run macros on Microsoft Excel (.xlsm) files.Built-in support for VBA macros without complex internet zone policy restrictions.Lightweight installation with a highly familiar, user-friendly interface.Completely free to download and use as your primary Office suite.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel block macros on my local network drive?

Microsoft Office uses a feature called 'Mark of the Web' to block macros from files identified as coming from the internet or untrusted zones. If your network drive is not explicitly trusted via hostname, Excel treats it as an external, potentially unsafe source.

Why did adding my network IP address to Trusted Locations not work?

For security reasons, Microsoft Office restricts the use of IP addresses for defining Trusted Locations. You must map the drive and add the path using the server's actual hostname (e.g., \\ServerName\Folder) for the trust settings to apply.

How long does it take for Microsoft 365 macro policy changes to apply?

Policy changes made in the Microsoft 365 Apps admin center (config.office.com) can take up to 24 hours to propagate to all users. Signing out of your Office account in Excel and signing back in can sometimes force an immediate update.