Share via

SOLVED - Excel 21 stating "Microsoft has blocked macros from running because the source of this file is untrusted." for a network file

Jason Sammut 0 Reputation points
2026-06-01T18:20:36.36+00:00

Hi all,

As per the title, I have a Macro enabled XLSM file that I have built myself and want to store and open on my own NAS drive.

I have created a Windows SMB share to the folder with a Drive letter of Z: e.g. : \192.168.0.50\User

Within the User folder above, there is a folder called Shared and within this folder is the macro enabled XLSM file.

When I map and connect to the drive I can see and access all of my files. When I open the file in Excel (or direct from double clicking on it) it opens with the message: "Microsoft has blocked macros from running because the source of this file is untrusted."

  • The file does NOT have the Unblock checkbox in Properties, so this is not the issue
  • When I try to use Trust Center to add a new location I get the error "The path you have entered cannot be used as a Trusted Location for security reasons. Choose another location or a specific folder." even with "Allow Trusted Locations on my network (not recommended)" being checked
  • As a temporary test I removed the checkbox from "Enable Protected View for files originating from the Internet" and "Enable Protected View for files located in potentially unsafe locations" to no avail
  • I also temporarily enabled: "Enable VBA macros (not recommended; potentially dangerous code can run)"

At the end of the day, all I want to do is open a file on my own network that I know is safe and Excel is preventing me from doing so. Does anyone have any ideas I can try?

Many thanks in advance!

Best regards,

Jason.

Microsoft 365 and Office | Excel | For home | Windows
0 comments No comments

Answer recommended by moderator

Jason Sammut 0 Reputation points
2026-06-01T19:25:22.7566667+00:00

When attempting the AI answer above, I had the same problem after adding my NAS to the trusted sites zone. However, what did fix the issue for me was to copy the file locally and open it there, THEN to save it back to my network location.

I believe in doing this it reset the MOTW flag and now I can open the file without issue. Marking this as solved.

Was this answer helpful?

0 comments No comments

1 additional answer

Sort by: Most helpful
  1. AI answer

    2026-06-01T18:20:57.8266667+00:00

    Excel is treating the NAS share as an untrusted “Internet” location, so macros are blocked even though the file has no Unblock checkbox. To allow the macros to run, the location of the NAS must be moved into a trusted zone or trusted location according to how Office evaluates Mark of the Web (MOTW) and zones.

    Use one of these supported approaches:

    1. Add the NAS share to a trusted zone in Windows

    Excel uses Windows Internet security zones to decide whether macros from a network share are blocked. If the share is seen as Internet/Restricted, macros are blocked; if it is Local intranet or Trusted sites, they are allowed.

    On the Windows device:

    1. Open Control PanelInternet OptionsSecurity.
    2. Select either Trusted sites (recommended) or Local intranet.
    3. Click Sites.
    4. Add the NAS by FQDN or IP address, for example:
      • \\192.168.0.50 or
      • http://192.168.0.50 (if using HTTP)
    5. If adding a UNC or http:// path, clear Require server verification (https:) for all sites in this zone.

    After this, the share is no longer treated as Internet/Restricted, so macros in files from that location are not blocked by default.

    If managing multiple devices, the same can be done centrally via Group Policy using the Site to Zone Assignment List policy under:

    • Windows Components\Internet Explorer\Internet Control Panel\Security Page (Computer or User Configuration).
    1. Use a Trusted Location in Office (if allowed)

    If the Trust Center currently refuses the path, it is because Excel still considers it a high‑risk network location. After adding the NAS to Trusted sites or Local intranet as above, retry:

    1. In Excel, go to FileOptionsTrust CenterTrust Center Settings.
    2. Select Trusted Locations.
    3. Ensure Allow Trusted Locations on my network (not recommended) is checked.
    4. Add a specific folder on the NAS, for example Z:\User\Shared.

    Files in a Trusted Location are allowed to run macros without being blocked by the Trust Center.

    1. Verify the file is not marked as from the Internet

    If the file was ever downloaded or emailed and then saved to the NAS, it might carry Mark of the Web (ZoneId=3). In that case, even from a network share, macros are blocked.

    On a local copy of the file (for testing):

    • Right‑click → Properties → if present, tick Unblock on the General tab. This removes MOTW.
    • Alternatively, use the PowerShell Unblock-File cmdlet as described in the documentation to remove the ZoneId.

    Once MOTW is removed and the NAS is in a trusted zone, macros in that file will run by default unless blocked by policy.

    1. If the share is still treated as Internet

    If, after these changes, Excel still blocks macros:

    • Confirm the NAS path is actually in Trusted sites or Local intranet by checking Control PanelInternet OptionsSecurity and reviewing the site list.
    • Ensure the mapped drive Z: is pointing to the same UNC/host that was added to the zone (for example, if the mapping uses \\192.168.0.50\User, that exact host/IP must be in the zone list).

    Once the NAS share is in Trusted sites or Local intranet, and the file is not marked with ZoneId=3/4, Excel will stop showing “Microsoft has blocked macros from running because the source of this file is untrusted” for that workbook.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.

    Was this answer helpful?

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.