Share via

blocked macro in xlsx file

Keith T. Terry 0 Reputation points
2026-03-10T12:19:44.9233333+00:00

how to unblock an xlsx file to run trusted macro in windows 11

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

2 answers

Sort by: Most helpful
  1. Nam-D 2,410 Reputation points Microsoft External Staff Moderator
    2026-03-10T14:03:12.8933333+00:00

    Hello @Keith T. Terry,

    Thank you for reaching out to the Microsoft Q&A Forum.

    Based on the information you provided, it appears that you are experiencing an issue where your Excel file is blocked and does not allow you to run macros. I understand how disruptive this can be, so please try the following steps to check whether the file is blocked locally after downloading:

    1. Right‑click the .xlsx file and select Properties.
    2. Under the General tab, look for the Security section.
    3. If you see the Unblock checkbox, please tick it and select OK to apply the change. User's image

    Please also verify if the folder containing your file is added as a trusted location by checking Excel Trust Center settings:

    1. Open Excel and go to File > Options.
    2. Select Trust Center, then click Trust Center Settings.
    3. Choose Trusted Locations.
    4. Select Add new location.
    5. Click Browse, choose the folder where your file is stored, and then click OK.

    Adding the folder as a trusted location may allow Excel to run macros without restrictions.

    Reference article: A potentially dangerous macro has been blocked - Microsoft Support

    If the steps above do not resolve the issue, could you please provide me with a bit more information so I can investigate further?

    1. Where did you download the file from? (SharePoint site, email attachment or another location)
    2. Which Office version are you using?
    3. Does this issue happen with all macro‑enabled files, or only with this specific file?

    Your answers will help me better understand the situation and guide you more effectively.

    Please let me know once you have any updates. I look forward to hearing from you and assisting you further. Please


  2. Q&A Assist
    2026-03-10T12:19:56+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To unblock an .xlsx file so trusted macros can run on Windows 11, use one of these supported methods depending on where the file is stored.

    1. Unblock an individual file downloaded from the internet or email
      1. Close Excel.
      2. In File Explorer, right-click the .xlsx file and select Properties.
      3. On the General tab, if you see a Security section with an Unblock checkbox, select Unblock.
      4. Select Apply and OK.
      5. Reopen the file in Excel; macros will run as long as no policy or Trust Center setting is blocking them.
      This removes the Mark of the Web (ZoneId) that causes macros from the internet to be blocked by default.
    2. Unblock using PowerShell (for one or more files)
      1. Close Excel.
      2. Open Windows PowerShell.
      3. Run:
              Unblock-File -Path "C:\Path\To\YourFile.xlsx"
        
        or for all files in a folder:
              Get-ChildItem "C:\Path\To\Folder" -Recurse | Unblock-File
        
      This removes the ZoneId (Mark of the Web) and allows VBA macros to run by default.
    3. If the file is on a network share or website
      • If the Unblock checkbox is available, use it as in step 1.
      • If there is no Unblock checkbox and macros are blocked for all files in that location, an admin can:
        • Add the share or site as a Trusted site, or
        • Add it to the Local intranet zone via the Site to Zone Assignment List policy.
      • Once the location is in Trusted sites or Local intranet, macros in files from that location are not blocked by default.
    4. If the file is on OneDrive or SharePoint
      • Prefer opening via Open in Desktop App from OneDrive/SharePoint; in this case the file will not have Mark of the Web.
      • If downloading first, then:
        1. Download the file.
        2. Use the Unblock checkbox or Unblock-File as in step 1 or 2.
      • Alternatively, save or move the file into a folder configured as an Office Trusted Location.
    5. Use Trusted Locations for groups of local files
      • For folders on the local device that contain many macro-enabled workbooks, configure that folder as a Trusted Location in Excel Trust Center. Files in Trusted Locations open with macros enabled even if they originally came from the internet (after Mark of the Web is removed or if they were never marked).

    After unblocking, if macros are still disabled, check with the organization’s admin whether macro policies such as “Block macros from running in Office files from the Internet” or “VBA Macro Notification Settings” are configured to block macros regardless of file trust.


    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.