how to unblock macro in an excel file

Ceron Jerome FRSS 20 Reputation points
2025-11-10T15:43:48.7666667+00:00

I cannot use a macro in an excel file. How can I unblock it?

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

Answer accepted by question author
Hendrix-C 19,970 Reputation points Microsoft External Staff Moderator
2025-11-10T16:54:32.96+00:00

Hi @Ceron Jerome FRSS

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

We suggest you follow this guideline to unblock macros in your files: 

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

  • If the Unblock options is not available, it's usually because that your file is currently saved in a OneDrive or SharePoint folder and it will be considered as from the internet.
  • You can try disconnecting OneDrive/SharePoint temporarily or move the file to your local folder and try the Unblock Security box again.

2- Add the file location as a trusted location  

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

User's image

 

  • 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 

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 

For better visualization about this guideline, you can watch this video Unblock macros downloaded from the internet | Excel Off The Grid | Microsoft macro security changes… 

(Note: We're providing this information as a convenience to you. The sites are not controlled by Microsoft and we can't make any representations regarding quality, safety or suitability of any software or information found there. Please make sure you completely understand the risk before retrieving any suggestions from the above link) 

Please understand that our initial response does not always resolve the issue immediately. However, you can try workaround and share us more detailed information, we can work together to find a solution.    

Thank you for your understanding and cooperation. I'm looking forward to your reply.


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?

1 person found this answer helpful.

2 additional answers

Sort by: Most helpful
  1. Ceron Jerome FRSS 20 Reputation points
    2025-11-12T07:08:22.3333333+00:00

    Thanks for your help, my issue is solved.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments

  2. AI answer

    2025-11-10T15:44:04.4133333+00:00

    To unblock macros in an Excel file, you can follow these steps:

    1. Remove Mark of the Web: Right-click on the Excel file, select Properties, and then check the Unblock checkbox on the General tab. This will remove the Mark of the Web, allowing macros to run.
    2. Using PowerShell: You can also use the Unblock-File cmdlet in PowerShell to remove the ZoneId value from the file, which allows VBA macros to run by default. This cmdlet does the same thing as selecting the Unblock checkbox.
    3. Trusted Locations: If the file is stored on a network share or a trusted website, you can designate that location as a Trusted site or add it to the Local intranet zone to prevent macros from being blocked.
    4. Open in Desktop App: If the file is stored on OneDrive or SharePoint, ensure that you open it using the Open in Desktop App option to avoid the Mark of the Web being applied.

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

    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.