logo
search
VBA & Macro Problems

How to Enable VBA Macros from Network Shared Drives in Microsoft 365

Partner EditorPartner Editor Oct 9, 2026 869 views

Question details

The user needs to successfully enable and run VBA macros in Microsoft 365 files that are stored on a network shared drive.

How to Enable VBA Macros from Network Shared Drives in Microsoft 365
Product
Microsoft 365
Device & OS
Windows
Scenario
Opening Office files containing VBA macros directly from a network file server or shared drive.
Observed behavior
Microsoft 365 blocks the VBA macros because the network location is treated as an untrusted internet zone, even if Trust Center settings are configured. The macros only work when the file is copied to the local computer.
Before you start

Ensure you have the exact IP address or fully qualified domain name (FQDN) of your network shared drive, and verify with your IT administrator that the files on this drive are safe to execute.

Solution 1Recommended

Add the Network Share to Trusted Sites in Internet Options

Configure your Windows internet properties to recognize the network share as a trusted location, which prevents Microsoft 365 from automatically blocking the macros.

By default, Microsoft 365 blocks macros in files originating from the internet or untrusted network locations. Adding the server's IP address or domain to your Local Intranet or Trusted Sites zone overrides this restriction at the system level.

1
Open Internet Options

Click the Windows Start menu, search for 'Control Panel', open it, and navigate to 'Internet Options'. Alternatively, search for 'Internet Options' directly in the Windows search bar.

2
Access Security Settings

Go to the 'Security' tab at the top of the Internet Properties window, and click on either the 'Local intranet' or 'Trusted sites' zone icon.

3
Open the Sites Menu

Click the 'Sites' button. If you selected Local intranet, you may need to click 'Advanced' in the next window to manually add a website.

4
Add the Network Location

Type the file server or network share's fully qualified domain name (FQDN) or IP address into the 'Add this website to the zone' field and click 'Add'.

5
Modify HTTPS Requirements

If you are adding a standard network path or HTTP URL, uncheck the box at the bottom that says 'Require server verification (https:) for all sites in this zone', then click 'Close' and 'OK' to save your changes.

Add the Network Share to Trusted Sites in Internet Options
Administrative Privileges Required: You may need administrator rights on your PC to modify Internet Options. If the 'Add' button is greyed out, contact your organization's IT department to have the policy updated.
Free Microsoft Office alternative

Try WPS Office for Seamless Macro Support

If you frequently encounter complex security blocks and macro restrictions in Microsoft 365, consider switching to WPS Office. It offers excellent compatibility with Excel macros and provides a straightforward, user-friendly environment for managing trusted documents.

Highly compatible with Microsoft Excel files, including VBA macros (.xlsm).Free, lightweight, and fast to launch on any Windows device.Intuitive interface that closely resembles Microsoft Office for seamless migration.Easily configure macro security settings without navigating legacy Windows Control Panel menus.
microsoft office alternative - wps office

Frequently Asked Questions

Why does Microsoft 365 block macros on my network drive even if the Office Trust Center is configured?

Microsoft 365 relies on the Windows Mark of the Web (MOTW) attribute to block macros from locations it considers to be on the internet. Network shares accessed via an IP address are often treated as internet zones by Windows, which overrides your Office Trust Center settings.

How do I find the IP address or FQDN of my network shared drive?

You can find this information by right-clicking the mapped network drive in Windows File Explorer, selecting 'Properties', and looking at the 'Target' or 'Network path' field. If it's not clear, consult your IT administrator for the exact server address.

Is it safe to uncheck 'Require server verification (https:)' for Trusted Sites?

It is generally safe if you are specifically adding an internal company network share or intranet IP address that you know is secure. However, you should not uncheck this option for external or public internet websites to avoid security vulnerabilities.