How to Enable VBA Macros from Network Shared Drives in Microsoft 365
Question details
The user needs to successfully enable and run VBA macros in Microsoft 365 files that are stored on a network shared drive.

- 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.
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.
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.
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.
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.
Click the 'Sites' button. If you selected Local intranet, you may need to click 'Advanced' in the next window to manually add a website.
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'.
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.

Copy the Office File to Your Local Drive
If you cannot change Windows network security settings, copying the file to a local trusted folder allows the macros to run without network restrictions.
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.

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.




