VBA & Macro Problems

How to Run Macros from an Excel File Stored on a NAS Server

John WilsonJohn Wilson Nov 10, 2026 871 views

Question details

The user needs to execute macros within an Excel workbook stored on a Network Attached Storage (NAS) or network share, which are currently being blocked by Microsoft Excel security settings.

How to Run Macros from an Excel File Stored on a NAS Server
Product
Microsoft Excel
Device & OS
not provided
Scenario
Opening and running a macro-enabled Excel workbook that is hosted remotely on a NAS server or a shared network drive.
Observed behavior
Excel's default security measures block the macros from running when the file is opened directly from a network location, preventing automation scripts from executing.
Before you start

Ensure that the NAS server or network share is fully controlled and explicitly trusted by your organization to prevent the execution of malicious or unauthorized VBA code.

Solution 1Recommended

Add the NAS Network Path to Excel's Trusted Locations

Configure Excel's Trust Center to recognize your NAS server as a safe environment, which will allow macros in those directories to run without security warnings.

By default, Excel applies stricter security protocols to files opened from a network location or the internet. To bypass these restrictions for approved directories, you must manually add the specific NAS path to your Trusted Locations list.

1
Open Trust Center Settings

Launch Excel, click on the 'File' tab in the top-left corner, and select 'Options'. From the left-hand pane of the Excel Options window, click on 'Trust Center', then click the 'Trust Center Settings' button.

2
Enable Network Trusted Locations

In the Trust Center window, select 'Trusted Locations' from the left menu. At the bottom of this pane, check the box labeled 'Allow Trusted Locations on my network (not recommended)'. This step is mandatory before adding a NAS path.

3
Add the NAS Path

Click the 'Add new location' button. Type the approved network path of your NAS share (for example, \\NAS-Server\SharedFolder\). If your macro files are inside subfolders, check the 'Subfolders of this location are also trusted' box.

4
Confirm and Save

Click 'OK' on all open dialog boxes to save your new security settings. Restart Excel and open your file from the NAS to run the macros seamlessly.

Add the NAS Network Path to Excel's Trusted Locations
Administrative Restrictions: If the option to add network locations is grayed out or missing, your organization's IT policy likely restricts this feature. You will need to contact your system administrator to whitelist the NAS path.
Free Microsoft Office alternative

Experience Seamless Macro Compatibility with WPS Office

Having trouble managing complex Trust Center settings and macro security in Excel? Try WPS Office. It provides robust support for VBA macros and seamless compatibility with Microsoft Excel files, all within a lightweight and free productivity suite.

  1. 1. Download and Install: Download WPS Office Free from the official website and follow the installation prompts.
  2. 2. Open Your Macro-Enabled File: Launch WPS Spreadsheet and open your .xlsm file directly from your NAS server.
  3. 3. Enable Macros Safely: If prompted by the top security warning bar, simply click 'Enable Macros' to run your VBA code.
Fully compatible with Microsoft Excel macro-enabled formats (.xlsm, .xls)Lightweight software that runs smoothly on Windows, Mac, and LinuxIntuitive security interface making trusted file management straightforward
microsoft office alternative - wps office

Frequently Asked Questions

Why does Excel block macros from my NAS server by default?

Excel defaults to blocking macros originating from network and internet locations to protect your computer from potentially malicious code. You must explicitly tell the application that a specific network location is safe.

Is it safe to allow trusted locations on my network?

It is safe only if you or your organization's IT department fully control the NAS or network share, and strictly monitor the files placed there. Never add public or untrusted network locations to your Trust Center.

Can I bypass the trusted location setup by mapping the NAS as a local network drive?

No. Mapping the NAS to a local drive letter (such as Z:) does not automatically make it a trusted location. You still need to add either the mapped drive letter or the original UNC path to your Excel Trusted Locations.

Why is the 'Add new location' button disabled in my Excel Trust Center?

If the button is disabled, your organization has likely implemented a Group Policy that prevents standard users from manually adding new Trusted Locations. You will need to contact your IT administrator to have the path approved and added centrally.