Share via

How do I get Microsoft to stop blocking the macros in the Microsoft Excel file that I downloaded from chatgpt?

Michael Ebaugh 0 Reputation points
2026-03-29T21:50:42.4166667+00:00

I used chatgpt to create a Microsoft Excel (.xlsm) file that contains macros. When I downloaded the file I got an error message saying that "Microsoft has blocked macros from running because the source of this file is untrusted." I clicked the hyperlink in the message and followed the instructions to allow the macros. The first set of instructions to access the document properties through internet options was not accurate in that the ability to check a box to unblock the content is not present with this file. The second option provided included adding the source of the content to the trusted sites. I did so and attempted to re-open the file but the same error appears again. How do I get Microsoft to stop blocking the macros?

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

1 answer

Sort by: Most helpful
  1. Q&A Assist
    2026-03-29T21:50:59.1833333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Excel is blocking the macros because the file is marked as coming from the Internet (it has Mark of the Web/ZoneId=3). To allow macros, the Mark of the Web must be removed or the file must be opened from a trusted location/zone.

    Use one of these approaches:

    1. Remove Mark of the Web from the downloaded file
      • In File Explorer, right‑click the .xlsm file.
      • Select Properties.
      • On the General tab, if you see Unblock, select the Unblock checkbox, then select OK.
      • Reopen the workbook; macros should now be allowed (subject to your macro settings).
      If the Unblock checkbox is not present:
      • Open Command Prompt or PowerShell.
      • Run the PowerShell cmdlet (adjust the path and file name):
             Unblock-File -Path "C:\Path\To\YourFile.xlsm"
        
      • This removes the ZoneId (Mark of the Web) so VBA macros can run by default.
    2. Store or open the file from a trusted location/zone
      • If the file is on a network share or website and there is no Unblock option, either:
        • Move/download the file to a local folder and then use Unblock or Unblock-File, or
        • Add that network location as a Trusted site or ensure it is in the Local intranet zone via Control Panel > Internet Options > Security.
      • For OneDrive/SharePoint files:
        • Use Open in Desktop App directly from OneDrive/SharePoint; in this case the file will not have Mark of the Web.
        • Or sync via the OneDrive sync client and open the synced copy; synced files do not get Mark of the Web.
    3. Verify macro policy settings (if still blocked)
      • If using Microsoft 365 Apps for enterprise and an admin has enabled the Block macros from running in Office files from the Internet policy, macros in Internet‑sourced files will remain blocked even after unblocking, unless policy is changed.
      • In that case, an admin must adjust macro policies (for example, using VBA Macro Notification Settings or trusted, signed macros) so that trusted files can run macros.

    Once the Mark of the Web is removed (or the file is opened from a trusted zone/location) and macro policies allow it, Excel will stop blocking the macros in that .xlsm file.


    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.