VBA & Macro Problems

How to Allow Macros from a Network Drive in Office

Bushra ParveenBushra Parveen Oct 26, 2026 868 views

Question details

Users need to allow macros to execute from files stored on a mapped network drive without triggering Microsoft Office security blocks.

How to Allow Macros from a Network Drive in Office
Product
Microsoft Office
Device & OS
not provided
Scenario
Opening a macro-enabled Office file stored on a network location or mapped drive.
Observed behavior
Office blocks the macros because the source is considered untrusted, and adding the mapped drive letter or IP address to Trusted Locations does not resolve the security warning.
Before you start

Ensure you have the exact server name for your network drive, and confirm with your IT administrator that running macros from this specific network location complies with your organization's security policies.

Solution 1Recommended

Map the Network Location Using the Server Name

Office security features often block IP-based network paths. Mapping the drive using the actual server name ensures the path can be properly recognized and trusted by the Office Trust Center.

Microsoft Office handles network security strictly and frequently distrusts paths mapped via an IP address. By remapping the network drive using the server name (hostname) and updating your Trust Center settings, Office can correctly validate the network directory.

1
Disconnect the IP-mapped drive

Open File Explorer, right-click on the network drive that is currently mapped using an IP address (e.g., \\192.168.0.1\networkdirectory), and select 'Disconnect'.

2
Remap using the server name

Map the network drive again, but this time enter the server-based path (e.g., \\fileserver\networkdirectory) instead of using the IP address.

3
Enable network Trusted Locations

Open your Microsoft Office application (such as Excel or Word). Navigate to File > Options > Trust Center, and click the 'Trust Center Settings' button. Select 'Trusted Locations' from the left menu and check the box at the bottom for 'Allow Trusted Locations on my network'.

4
Add the new server path

Click 'Add new location', enter the newly mapped server name path into the field, check 'Subfolders of this location are also trusted' if necessary, and click OK to save your settings.

Map the Network Location Using the Server Name
Security Warning: Do not weaken macro security settings or grant full permissions unless explicitly approved by your system administrator, as macros can pose significant security risks.
Free Microsoft Office alternative

Try WPS Office for Seamless Macro and File Compatibility

If Microsoft Office's strict network macro policies disrupt your workflow, consider WPS Office. It provides robust compatibility with Microsoft formats, including macro-enabled files, within a lightweight and familiar interface.

  1. 1. Download WPS Office: Visit the official WPS website to download the free version of the office suite.
  2. 2. Install and Launch: Follow the on-screen instructions to install WPS Office on your computer.
  3. 3. Open Your Macro-Enabled File: Launch WPS Spreadsheet or Writer and open your network-stored file seamlessly.
Highly compatible with Microsoft Office formats, including macro-enabled workbooks (.xlsm) and documents (.docm).Free and lightweight, consuming minimal system resources compared to other office suites.Familiar user interface requiring practically no learning curve for easy migration.Straightforward file management and accessible security settings.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Office block macros even after adding the IP address to Trusted Locations?

Microsoft Office security protocols often do not recognize IP addresses in the Trusted Locations list as secure. To resolve this, you must use the server's hostname or fully qualified domain name (FQDN) instead of the IP address.

Is it safe to allow macros from a network drive?

It is only safe if you completely trust the network environment and the source of the files. Always consult your IT administrator before allowing network macros, as malicious macros can execute code that harms your system.

How do I enable 'Allow Trusted Locations on my network'?

In your Office application, navigate to File > Options > Trust Center > Trust Center Settings > Trusted Locations. At the bottom of the window, check the box that says 'Allow Trusted Locations on my network (not recommended)' and click OK to save your changes.