Share via

Microsoft blocking Excel macros

Bob Kobistek 0 Reputation points
2026-06-11T12:10:29.2333333+00:00

"Microsoft" has suddenly decided to block macros on all my Excel files -- files that I created! I've tried every fix suggested by the Microsoft website and Chat GPT. Nothing is working!

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

2 answers

Sort by: Most helpful
  1. Rin-L 21,280 Reputation points Microsoft External Staff Moderator
    2026-06-11T13:56:13.0733333+00:00

    Hi @Bob Kobistek,

    I’ll be glad to help you look into this. To better understand the scenario and help narrow down the root cause, I’d like to clarify a few points with you: 

    • When you open the file, do you see any banner or warning message at the top? If possible, could you share a quick screenshot of that message?
    • Just to confirm, is this happening only with the files that you created, or also with files shared by others? Also, where are these files currently stored (OneDrive, SharePoint, or a local folder)?
    • Could you try going to File Explorer > right-click the file > Properties > General tab, and check if there is an “Unblock” option available?
    • If you create a brand-new Excel file with a macro, save it locally, and reopen it, does it also get blocked?

    You mentioned you’ve already tried several troubleshooting steps, would you mind listing what you’ve done so far? That way I can avoid repeating the same suggestions and look into other possible solutions for you.

    Once I have a bit more information, I’ll be able to better understand your situation and suggest the most appropriate next steps. So, if you have any updates or additional details to share, please feel free to leave a comment under this post, I’ll be more than happy to continue assisting you. 

    Thank you for taking the time, and I’m looking forward to your reply!


    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-06-11T12:10:42.81+00:00

    Recent security changes in Microsoft 365 mean that Excel now blocks VBA macros by default in files that are considered to be from the internet or other untrusted locations, even if those files were created personally. This is by design to reduce malware and ransomware risk.

    Use the following checks and fixes, in order:

    1. Confirm why the macros are blocked
    • When opening the workbook, look at the banner at the top:
      • If it says: “Microsoft has blocked macros from running because the source of this file is untrusted”, Excel is treating the file as coming from the Internet or another untrusted zone (via Mark of the Web / ZoneId).
    1. If the file is on a local drive
    • Right-click the .xlsm file → Properties.
    • On the General tab, if there is an Unblock checkbox in the Security section, select it and choose OK.
    • Reopen the file; macros should run unless a stricter policy is in place.
    • If there is no Unblock checkbox, the file may not be marked as from the Internet, or it may be on a network share (see next step).
    1. If the file is on a network share (NAS, file server, etc.)
    • Files opened via a UNC path or IP address (for example, \\192.168.x.x\share) can be treated as Internet zone and have macros blocked.
    • Options:
      1. Temporarily copy the workbook to a local folder (like Desktop), open it once there, then save it back to the network location. This can clear the Mark of the Web and has resolved similar cases.
      2. Ensure the network location is treated as trusted:
        • On Windows, go to Control PanelInternet OptionsSecurity.
        • Add the file server or share (FQDN or IP) to Trusted sites or ensure it is in Local intranet.
        • Be aware this reduces protection for that location; only do this for locations that are fully controlled.
    1. Check for Mark of the Web (ZoneId) directly
    • Open a Command Prompt and run:
        notepad {full-path-to-file}:Zone.Identifier
      
    • In the Notepad window, look for ZoneId=:
      • 3 = Internet, 4 = Restricted sites → macros will be blocked by default.
    • To clear this flag via PowerShell, use the built-in Unblock-File cmdlet, for example:
        Unblock-File -Path "C:\Path\To\Workbook.xlsm"
      
    • Removing the ZoneId allows macros to run by default, provided no stricter Office policy is in place.
    1. Check organization policies (if this is a work or school account)
    • Admins can enforce:
      • Block macros from running in Office files from the Internet (recommended baseline), and/or
      • VBA Macro Notification Settings.
    • If the “Block macros from running in Office files from the Internet” policy is Enabled or Not Configured (with the new default behavior), macros in files marked as Internet will be blocked and show a Security Risk banner with no “Enable Content” button.
    • Only an administrator with Group Policy or cloud policy access can change these settings. Typical secure configurations are:
      • Block macros from the Internet, and
      • Allow only digitally signed macros from trusted publishers.
    1. If using personal Microsoft 365 (no central admin)
    • When the macro-blocking change is active, the old “Enable Content” button is no longer shown for Internet-marked files.
    • The practical options are:
      • Remove Mark of the Web (Unblock in Properties or Unblock-File), and/or
      • Store and open the files only from locations that are not treated as Internet/Restricted (for example, a normal local folder, or a properly configured trusted intranet location).

    If macros are still blocked after clearing Mark of the Web and using a trusted location, the device is likely governed by a policy that only an administrator can relax (for example, “Disable all macros without notification” or “Disable all except digitally signed macros”). In that case, the resolution is to have an admin adjust the macro policies or sign the macros with a trusted certificate.


    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.