Share via

How to unblock an Excel file that has macros that I received via email

Jerry Raack 0 Reputation points
2026-05-22T18:59:06.01+00:00

I received an email that has an excel file that has macros. I need to run the macros, but Microsoft has blocked running them. How do I unblock this file?

Microsoft 365 and Office | Excel | For business | Windows

3 answers

Sort by: Most helpful
  1. Md Samtullah Ansari 0 Reputation points
    2026-05-25T13:24:21.8466667+00:00

    After opening the file:

    1. Look for a yellow Security Warning bar at the top.
    2. Click Enable Content.
    3. Choose Enable Macros.

    Was this answer helpful?


  2. Alina Le 2,370 Reputation points Independent Advisor
    2026-05-23T16:19:30.38+00:00

    Hello @Jerry Raack

    As you have shared that you received this file via email, it were possibly blocked macros in files downloaded from the internet for security reasons (they may contain malware). If you trust the source of the email and file, you can unblock it using one of the methods below.


    1/ Remove the Mark of the Web (MOTW)  

    • 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 User's image

    User's image

    You can refer to this Microsoft documentation for detailed information.  

    Macros from the internet are blocked by default in Office - Microsoft 365 Apps | Microsoft Learn 

    2/ Move File to a Trusted Location

    • In Excel: File -> Options -> Trust Center -> Trusted Locations.
    • Add a folder (e.g., C:\TrustedDocs) and move your file there.
    • Reopen your Excel file to see if the issue persists.

    User's image User's image User's image

    User's image

    Make sure the option "Subfolders of this location are also trusted" is checked so that you can still run macros anytime you create a subfolder inside that folder.

    User's image

    3. Verify Macro Settings

    • Go to File -> Options -> Trust Center -> Trust Center Settings -> Macro Settings again.
    • Ensure it’s not set to “Disable all macros without notification.”

    User's image

    4/ Check Organizational Policy

    If you’re on Microsoft 365 or a corporate network, your admin may have enforced macro blocking.

    You might need to contact IT (who has global administrative rights for your account tenant) to confirm if macros from the internet are blocked by policy.

    You can also check with your colleagues to see if they encounter a similar issue, to rule out whether this is related to your organization’s policy.


    Even though I’ve tried to make this as close as possible to your experience, we may be in different testing environments, and I might not fully understand your needs. Please feel free to contact me again if you still have any concerns.

    Have a great day!


    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.

    Was this answer helpful?


  3. AI answer

    2026-05-22T18:59:28.39+00:00

    To unblock the Excel file and allow its macros to run, first ensure the file is saved locally (for example, to Documents, Desktop, or a folder on the hard drive or OneDrive), then remove the “Mark of the Web” from the file.

    Use one of these methods:

    Method 1: Unblock via File Properties

    1. Save the email attachment to a local folder (not directly from the email).
    2. Open File Explorer and browse to the saved Excel file.
    3. Right-click the file and select Properties.
    4. On the General tab, at the bottom, look for the Security section.
    5. Select the Unblock checkbox.
    6. Select OK.
    7. Open the file in Excel; macros should now be allowed to run unless blocked by policy or Trust Center settings.

    Method 2: Use PowerShell (Unblock-File)

    1. Save the attachment to a local folder.
    2. Open Windows PowerShell.
    3. Run:
         Unblock-File -Path "C:\path\to\your\file.xlsx"
      
    4. Open the file in Excel; removing the ZoneId (Mark of the Web) allows macros to run by default, subject to any macro policies.

    If the file is stored on a network share or a trusted website and the Unblock checkbox does not appear, either:

    • Download it locally and unblock as above, or
    • Ask an admin to configure that location as a Trusted site or ensure it’s in the Local intranet zone so macros from that location are not blocked.

    If the file is on OneDrive or SharePoint, another option is to open it using Open in Desktop App from the web interface; files opened this way do not get Mark of the Web and macros are not blocked by that mechanism.


    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.