Share via

Blocked Macro

Astello, Cynthia P 5 Reputation points
2026-04-02T17:46:45.8433333+00:00

I have an excel file that needs to run a macro and there is a Security Risk warning that pops up and no I do not have the Macro option. I've been using this for over 7 years. I've set settings on my computer to trust a site and enable macros but nothing is working. Need assistance asap. User's image

Microsoft 365 and Office | Excel | For education | Windows

2 answers

Sort by: Most helpful
  1. Hendrix-C 17,580 Reputation points Microsoft External Staff Moderator
    2026-04-02T18:13:41.18+00:00

    Hi @Astello, Cynthia P,

    According to your concern, for the most appropriate assistance, could you provide more detailed information about this situation:

    • When you mentioned "set settings to trust a site", did you refer to Trust Locations settings in Excel > File > Options > Trust Center settings or Trusted Sites in Control Panel > Network and Internet > Internet options?
    • Where is the file located (in OneDrive/SharePoint folder, download from drive network, stored locally, etc.)?

    In the meantime, I suggest you can try using the Unblock security box workaround to see if it helps enable macro for your file:

    • Open File Explorer, navigate to your Excel file that you need to enable macros 
    • Right click on it and choose Properties 
    • In General tab, check the Unblock box for the Security option. 

    User's image

    If the "Unlock" checkbox isn't available, you can use PowerShell to unlock your file's macro (if your device has permission to use PowerShell):

    • In the search bar, type PowerShell and select "Run as administrator."
    • Then, paste this script into PowerShell > Enter to unlock your file:
        Unblock-File -Path "C:\Path\YourFile.xlsm"
      

    Please understand that my initial response does not always resolve the issue immediately. However, you can try these steps and let me know if it works for you. If not, we can work together to find a solution.

    If you have any questions or need further assistance, please feel free to share them in the comments on this post so I can continue to support you.    

    Thank you for your understanding and cooperation. I'm looking forward to your reply.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it.

    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

    Was this answer helpful?


  2. AI answer

    2026-04-02T17:47:02.4333333+00:00

    The banner shown means the file has Mark of the Web (MOTW) and, with the new default behavior, macros from the internet are blocked and the usual “Enable Content” button no longer appears. Trust Center macro settings or trusting the site alone will not override this.

    Use one of these supported approaches to allow the macro to run in a file that is genuinely trusted:

    1. Remove Mark of the Web from the file (local copy)
      1. Close Excel.
      2. In File Explorer, right‑click the workbook file.
      3. Select Properties.
      4. On the General tab, if a Security section appears with an Unblock checkbox, select Unblock.
      5. Select OK, then reopen the file in Excel. Macros will run as long as no policy or Trust Center setting is blocking them.
      This is equivalent to removing the ZoneId using the Unblock-File PowerShell cmdlet and is the primary way to clear the “Security Risk” banner for a trusted file.
    2. If the file is on a network share or website
      • If there is no Unblock checkbox, either:
        • Download the file to a local folder, unblock it as above, and then use it from there, or
        • Have an admin designate that network location as a Trusted site or ensure it is in the Local intranet zone so macros from that location are not blocked by default.
    3. If the file is on OneDrive or SharePoint
      • Open it using Open in Desktop App from the OneDrive/SharePoint web UI; files opened this way do not get Mark of the Web.
      • Alternatively, sync the library with the OneDrive sync client and open the synced file from a known folder (for example, Documents); synced files do not have Mark of the Web.

    If organization-wide policies such as “Block macros from running in Office files from the Internet” are enabled by an administrator, those policies can still block macros even after unblocking the file; in that case the policy must be adjusted by the admin.


    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.