Share via

unbolock macro

Shannon Nielsen 0 Reputation points
2026-03-26T22:57:03.0466667+00:00

message on top of screen saying "microsoft has blocked macros from running because the source of the file is untrusted"

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

2 answers

Sort by: Most helpful
  1. AlexDN 11,420 Reputation points Microsoft External Staff Moderator
    2026-03-27T01:02:46.2566667+00:00

    Dear @Shannon Nielsen,
    Welcome to Q&A forum. I understand that you are seeing the message “Microsoft has blocked macros from running because the source of the file is untrusted” at the top of your Excel file.

    This behavior is expected in Microsoft 365 Apps for Windows. When an Excel file is downloaded from the internet, received by email, or copied from certain external locations, Windows marks the file as coming from an untrusted source. To help protect your device and data, Excel automatically blocks macros in these files.

    If you trust the source of the file, you can unblock it by following the steps below:

    Option 1: Unblock a single file

    Close Excel completely.

    Open File Explorer and locate the Excel file (.xlsm).

    Right‑click the file and select Properties.

    In the General tab, under Security, check Unblock.

    Select Apply, then OK.

    Reopen the file in Excel.

    Note: If you do not see the “Unblock” option in the file’s Properties, this usually means the file is not stored locally on your device or the macro block is being enforced by Windows or organizational security settings, rather than by the file itself.

    Option 2: Use a Trusted Location (recommended if you use macros often)

    Open Excel and go to File > Options.

    Select Trust Center, then Trust Center Settings.

    Choose Trusted Locations.

    Select Add new location and choose the folder where the file is stored.

    Select OK, then restart Excel.

    Please note that in some work or school environments, security policies may prevent users from unblocking macros locally. If the options above are unavailable or do not work, your IT administrator may need to review the macro security policy.

    Option 3: Check with your IT administrator

    If macros are still blocked, the behavior is likely controlled by an organizational security policy. In that case, individual users cannot override the setting locally, and an IT administrator would need to review or adjust the macro security configuration.

    Important note Changing Excel macro settings (for example, enabling all macros) does not override this block. The restriction is applied before Excel loads the macro as part of Windows and Microsoft 365 security protections.

    Please understand that our initial response does not always resolve the issue immediately. However, with your help and more detailed information, we can work together to find a solution.

    I truly appreciate your patience and understanding. If you have any further questions or need further clarification, please feel free to reach out. I'm looking forward to hearing from you. 

    Thank you for your cooperation.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


  2. Q&A Assist
    2026-03-26T22:57:16.6933333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To unblock the macro in a file that shows “Microsoft has blocked macros from running because the source of the file is untrusted,” the file’s Mark of the Web (MOTW) must be removed or the location must be trusted.

    Use one of these approaches, depending on how the file is stored and used:

    1. For a single downloaded Excel file (from email, web, etc.)
      1. Close Excel.
      2. In File Explorer, right‑click the workbook (.xlsm, .xlsb, etc.) and select Properties.
      3. On the General tab, if you see an Unblock checkbox, select it.
      4. Click Apply and OK.
      5. Reopen the file in Excel; macros should now be allowed (unless a policy blocks them).
      Alternatively, an admin can run PowerShell and execute:
         Unblock-File -Path "C:\Path\To\YourFile.xlsm"
      
      This removes the ZoneId (MOTW) and has the same effect as the Unblock checkbox.
    2. For many files in a folder
      1. Put all trusted macro files in a folder, for example C:\TrustedMacros.
      2. Open PowerShell as Administrator.
      3. Run:
              $root = "C:\TrustedMacros"
              Get-ChildItem -Path $root -Recurse | Unblock-File
        
      4. Reopen the files in Excel.
    3. If files are on a network share or internal website
      • If the Unblock checkbox is missing or ineffective and the share is treated as Internet zone, configure the location as trusted:
        1. Open Control Panel > Internet Options > Security.
        2. Select Trusted sites or Local intranet (recommended for internal shares).
        3. Click Sites and add the file server FQDN or IP (for example \\fileserver or https://intranet.example.com).
        4. Apply the changes.
      • After the share is in Trusted sites or Local intranet, reopen the workbook; macros from that location will not be blocked by MOTW.
    4. For files on OneDrive or SharePoint
      • Prefer Open in Desktop App directly from OneDrive/SharePoint.
      • If downloading first, then:
        1. After download, use Properties > Unblock on the local copy, or
        2. Use Unblock-File in PowerShell as shown above.
      • An admin can also add the SharePoint/OneDrive URL to Trusted sites so files from there are not treated as Internet zone.
    5. For macro-enabled templates or add-ins
      • Templates (.dotm, .xltm, etc.):
        • Remove MOTW via Properties > Unblock, or
        • Store them in an Office Trusted Location, or
        • Sign them with a digital certificate and configure that certificate as a trusted publisher.
      • Excel add-ins (.xla, .xlam):
        • Remove MOTW via Unblock, and/or
        • Store them in a Trusted Location.
    6. Organization-wide control via policy (admins)
      • The policy Block macros from running in Office files from the Internet controls this behavior:
        • Enabled (recommended): macros from Internet/MOTW files are blocked.
        • Disabled or Not Configured: Office respects Trust Center macro settings and may show the older Enable content warning instead of hard blocking.
      • This policy is part of the Microsoft 365 Apps security baseline and should only be relaxed temporarily while designing a safe macro strategy.

    Security note: Only unblock or trust files and locations that are fully trusted. Unblocking removes an important protection against malicious macros.


    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.