Share via

Disabling Macros

Michael Crosby 0 Reputation points
2026-06-09T21:36:28.0066667+00:00

Microsoft has disabled macros on an Macro-enabled Excel Worksheet that I need to use for a report. Microsoft's guidance for unblocking a single file or website isn't working. Is there any other way that I'm missing?

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

2 answers

Sort by: Most helpful
  1. Hendrix-C 17,495 Reputation points Microsoft External Staff Moderator
    2026-06-09T22:47:42.23+00:00

    Hi @Michael Crosby,

    Based on your sharing, may I confirm that you have tried the Unblocking Security box and adding website as Trusted Sites, but the macro is still blocked?

    In that case, I suggest you can try some other steps to unblock the macro in your Excel file:

    1/ Use PowerShell

    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"
    
    • If you don't know your file path, you can open File Explorer > navigate to the folder you store the file > select the file and right-click > Copy as Path (or use short-cut Ctrl+Shift+C) > paste it to replace the "C:\Path\YourFile.xlsm" part

    User's image

    2/ Add the file location as a trusted location  

    • Open Excel and go to File > Options > Trust Center > Trust Center Settings
    • Select Trusted Locations in the left bane > Add new location > Browse and navigate to the folder where you keep the file that needs to enable macro
    • Press OK to close all the dialog boxes then try opening your file again

    3/ Adjust macros settings

    • Open the Excel file that needs macro enabling.
    • If you see a yellow warning bar at the top with the message "SECURITY WARNING: Macros have been disabled", click Enable Content to enable macro for the file immediately

    If it is showing a red warning bar, you can adjust the trust center settings for macros by

    • Go to File > Options > Trust Center > Trust Center Settings
    • Click Macro Settings and choose "Enable VBA macros" (only if you're sure the file is safe)
    • Then click OK to save the settings and reopen the documents

    If the issue still persists, for further assistance, please share the detail about where the file is located (in OneDrive/SharePoint folder, download from drive network, stored locally in Download/Desktop folder, etc.).

    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 it not, we can work together to figure out the 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 "YES" 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-06-09T21:36:55.4233333+00:00

    Yes. Besides unblocking a single file or trusting a specific site, there are several other controls that can affect whether macros run. Each needs to be checked, because any one of them can keep macros disabled even if the file itself looks “unblocked.”

    1. Check Excel’s macro settings in Trust Center
      1. In Excel, select File > Options.
      2. Select Trust Center, then Trust Center Settings.
      3. Select Macro Settings.
      4. Ensure the setting isn’t Disable all macros without notification. For most scenarios, use Disable all macros with notification so macros can be enabled per file.
      5. If macros must run more broadly, consider Disable all macros except digitally signed macros and sign the workbook with a trusted certificate.
      Note: These settings apply per app. Changing them in Excel does not change them for Word or PowerPoint.
    2. Remove “Mark of the Web” (MOTW) from the file Even if the file is on a network share or local drive, it may still be tagged as coming from the internet and blocked. On Windows:
      1. Close Excel.
      2. In File Explorer, right‑click the workbook, choose Properties.
      3. On the General tab, if there is an Unblock checkbox, select it and choose OK.
      4. Reopen the file in Excel and enable macros when prompted.
      If the Unblock checkbox is missing but the file was originally downloaded or emailed, copying it locally, opening it, then saving it back to the network location can clear the MOTW flag in some cases. Alternatively, an admin can use the PowerShell Unblock-File cmdlet to remove the ZoneId (MOTW) from the file.
    3. Check organization policies that manage macros If the device is managed (work or school), Group Policy or cloud policy can override local settings:
      • VBA Macro Notification Settings policy can be configured to:
        • Block macros from the internet entirely (recommended baseline), or
        • Allow macros only if they are digitally signed by a trusted publisher, or
        • Disable all macros without notification.
      When this policy is Enabled with “Disable all except digitally signed macros” and “Require macros to be signed by a trusted publisher,” unsigned macros will not run even if the file is unblocked and Trust Center is relaxed. If the policy is Not Configured or Disabled, Excel falls back to the user’s Trust Center macro settings. An admin may need to:
      • Adjust the VBA Macro Notification Settings policy to allow macros from trusted sources, or
      • Ensure the file’s macros are signed with a certificate installed as a Trusted Publisher on the device.
    4. Use trusted network locations or zones (admin-controlled) For files on internal file servers or trusted websites, an admin can:
      • Designate the share or site as a Trusted site, or
      • Ensure the location is in the Local intranet zone.
      This prevents macros from those locations from being treated as “from the internet” and blocked by default. Note that trusting a site grants elevated permissions beyond Office, so this must be done carefully.
    5. Special case: Excel 4.0 (XLM) macros and add-ins If the workbook or its add-ins rely on Excel 4.0 (XLM) macros, a policy that blocks XLM macros can break functionality even when VBA macros are allowed. In that case, an admin can:
      • Review the Prevent Excel from running XLM macros policy, or
      • Adjust Macro Notification Settings to control when XLM macros are enabled.

    If all file-level unblocking steps have been tried and macros are still blocked, the most likely remaining cause is an organization policy (VBA Macro Notification Settings or related macro/XLM policies). In that case, the admin must adjust those policies or require the workbook to be digitally signed and trusted.


    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.