Share via

Unable to run excel vba macros in a file on a trusted intranet share

Mukesh Sundaram 0 Reputation points
2026-03-12T02:42:58.74+00:00

Have tried all suggested options but am still unable to get past "Microsoft has blocked macros from running because the source of this file is untrusted" <Learn More> which leads to steps which do not do it for me.

Microsoft 365 and Office | Excel | For home | Windows
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sumit D - IA 160.7K Reputation points Independent Advisor
    2026-03-12T03:31:01.6433333+00:00

    Hi Mukesh,

    See if the following helps:

    Via https://www.reddit.com/r/excel/comments/11vl2xl/how_can_i_unblock_macros_that_microsoft_has/

    • Go to File → Options → Trust Center → Trust Center Settings → Trusted Locations → Add New Location
    • Enter the full UNC path: \\ServerName\SharedFolder (not a drive letter)
    • Check "Subfolders of this location are also trusted"
    • Check "Allow Trusted Locations on my network" at the bottom of the same screen.

    Please verify that you are doing Subfolders and Allow Trusted location which should solve it.

    I’m eager to hear back and work together to find a solution.

    Standard 3rd party link disclaimer:

    There may be links to non-Microsoft websites that provide accurate and safe information. Watch out for ads on websites frequently classified as PUP (Potentially Unwanted Products). There is no need to buy paid products to fix your computers, as they sometimes do more harm than good.

    0 comments No comments

  2. Q&A Assist
    2026-03-12T02:43:12.94+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Excel is still treating the file as coming from an untrusted Internet zone, even though it is on an intranet share. Fixing this requires addressing Mark of the Web (MOTW) and the zone assignment of the share.

    Use these checks and steps in order:

    1. Confirm and remove Mark of the Web on the file
      1. Copy the Excel file from the share to the local PC (e.g., Desktop).
      2. Right‑click the file → Properties.
      3. On the General tab, if there is an Unblock checkbox under Security, select Unblock and click OK.
      4. Open the unblocked file in Excel and confirm macros run.
      5. If needed, copy this unblocked file back to the share.
      Alternatively, on a local copy, run in PowerShell:
         Unblock-File -Path "C:\Path\To\YourFile.xlsm"
      
      This removes the ZoneId/MOTW and has the same effect as the Unblock checkbox.
    2. Ensure the network share is not treated as Internet zone If the share is considered in the Internet zone, macros will be blocked even if on a network path.
      1. On Windows, open Control PanelInternet OptionsSecurity.
      2. Check Local intranet and Trusted sites zones.
      3. If users access the share by IP or UNC path and it is not in Local intranet or Trusted sites, add it:
        • Go to Security tab → select Trusted sites or Local intranetSites.
        • Add the file server FQDN, IP, or share URL as appropriate.
        • If adding network shares or http:// URLs, clear Require server verification (https:) for all sites in this zone.
      4. Close and reopen Excel and re‑open the file from the share.
      Important: Locations in Trusted sites or Local intranet are not blocked for macros, so ensure only controlled, secure locations are added.
    3. Use a Trusted Location for a folder of macro files If there is a folder on the local device where these files can reside:
      1. Move or save the macro workbook(s) to a folder on the PC.
      2. Configure that folder as a Trusted Location in Office (Trust Center) so macros run without MOTW blocking.
    4. For centrally managed environments (admins) If this is for multiple users and the share is trusted:
      • Use Group Policy Site to Zone Assignment List to place the file server or SharePoint/OneDrive domain into Trusted sites or Local intranet so downloaded files are not treated as Internet zone.

    Once the file no longer has Mark of the Web and the share is in Local intranet or Trusted sites, Excel will stop showing “Microsoft has blocked macros from running because the source of this file is untrusted” for that location, unless an explicit macro‑blocking policy is configured.


    References:

    0 comments No comments

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.