Share via

Excel Macros are blocked in a file

Greg at Reliance 0 Reputation points
2026-02-15T15:59:49.2866667+00:00

I have an excel spreadsheet that the Macros are blocked, I can't seem to get them released to use them.

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

3 answers

Sort by: Most helpful
  1. Michael Stewart 0 Reputation points
    2026-02-19T20:54:55.37+00:00

    The files was copied from a WIndows 10 PC to a new Windows 11 PC.


  2. Ruby-N 8,325 Reputation points Microsoft External Staff Moderator
    2026-02-15T16:34:36.7633333+00:00

    Dear @Greg at Reliance

    Thank you for posting your question in the Microsoft Q&A forum.   

    I understand how inconvenient it can be when you open an Excel workbook and the macros are blocked, preventing the file from working as intended. 

    This usually happens because Excel blocks macros in files that may not be safe. When a macro‑enabled workbook is downloaded from email, the web, or certain network locations, Windows adds a “Mark of the Web.” Excel sees this mark and treats the file as untrusted, so macros are disabled until the file or its folder is trusted.  

    Microsoft introduced this behavior to prevent attacks, since harmful VBA macros are often used to spread malware. The block appears anytime a file has the Mark of the Web or comes from a location that hasn’t been marked as trusted.  

    To help me better understand the situation and assist you effectively, could you please share a few details such as:   

    1/ Can you tell me where this Excel file originally came from? 

    Example: You may have received the file from a colleague by email, or downloaded it from a website, Teams, or SharePoint, etc. 

    2/ Was the file created by you or was it sent to you by someone else? 

    3/ Are you seeing a yellow security warning bar at the top of Excel when you open it? 

    4/ Is the file stored on your local computer a shared network drive OneDrive SharePoint or another cloud service? 

    This will help us better understand the context and provide more targeted support. Any additional information will help us better understand and support you.    

    Below are several ways to unblock your file depending on how you received or stored it: 

    Option 1: Remove the Mark of the Web tag from the file 

    Open File Explorer, find the file you need to enable macros. 

    Right-click on it and select Properties. 

    On the General tab, check the "Unlock" box under the "Security" option. 

     Imagem do usuário

    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, use this script to unlock your file: 

    Unblock-File -Path "C:\Path\YourFile.docx" 
    

    Option 2: Add the file location as a trusted location   

    Open Excel and go to File > Options > Trust Center > Trust Center Settings. 

     Imagem do usuário

    Select Trusted Locations in the left bane > Add new location > Browse and navigate to the folder where you keep the files need to enable macro.  

    Press OK to close all the dialog boxes then try opening your macro-enabled excel file again. 

    Option 3: Enable macros in Excel  

    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. 

    You can also adjust the trust center settings for macros by: Go to File > Options > Trust Center > Trust Center Settings. 

    Click Macro Settings and choose between "Disable VBA macros with notification" (which will show a yellow warning bar as I mentioned above) and "Enable VBA macros" (only if you're sure the file is safe)  

    Then click OK to save the settings. 

    Option 4: Depending on where you download the file from 

    How macros are handled depends on where the file is stored: 

    • Files stored on a network share or a trusted internal website. 
    • Files stored in cloud services such as OneDrive or SharePoint. 

    This article provides detailed explanations for both scenarios: Macros from the internet are blocked by default in Office - Microsoft 365 Apps | Microsoft Learn 

    As community moderators, we kindly ask for your understanding that our access to internal development details is limited. Our primary role is to guide users toward the appropriate resources and support channels. While we may not have visibility into performing deeper backend analysis, we’ll continue doing our best to support you within the scope of our responsibilities.  

    I hope this information is helpful. If you have any questions or need further support, please don’t hesitate to reach out at any time. 

    Thank you for your patience and understanding. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have any 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. 


  3. Q&A Assist
    2026-02-15T15:59:57.1+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    If your Excel spreadsheet has macros that are blocked, you can take several steps to allow them to run. Here are some common approaches:

    1. Unblock the File: Right-click on the Excel file, select Properties, and then check the Unblock checkbox on the General tab if it is available. This removes the Mark of the Web that blocks macros.
    2. Using PowerShell: You can also use the Unblock-File cmdlet in PowerShell to remove the Mark of the Web from the file.
    3. Trusted Locations: If the file is located on a network share or a trusted website, you can designate that location as a Trusted site. This will allow macros to run without being blocked.
    4. Open in Desktop App: If the file is stored on OneDrive or SharePoint, try opening it using the Open in Desktop App option. This can prevent the Mark of the Web from being applied.
    5. Check Security Policies: Ensure that your organization's security policies allow macros to run. If macros are blocked by policy, you will need to contact your IT administrator to change this setting.

    By following these steps, you should be able to enable macros in your Excel file.

    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.