Share via

enable macro in excel

John Fischer 0 Reputation points
2026-03-23T20:06:06.71+00:00

I am unable to run a Macro in Excel. I need help enabling the Macro

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

2 answers

Sort by: Most helpful
  1. Hendrix-C 13,005 Reputation points Microsoft External Staff Moderator
    2026-03-23T21:42:10.2733333+00:00

    Hi @John Fischer,

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

    The previous response by Q&A Assist does provide basic troubleshooting steps for unblocking macros and I suggest you can try them to see if it helps. The guideline I provide below will have some steps as same as the previous reply but with some more detailed explanation:

    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 "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"
    

    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 

    You can also adjust the trust center settings for macros by 

    • Go to File > Options > Trust Center > Trust Center Settings 
    • Click Macro Settings 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: I'm providing this information as a convenience to you. The sites are not controlled by Microsoft, and I 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 these steps and let me know if it works for you.  

    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 "Accept Answer" 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

    0 comments No comments

  2. Q&A Assist
    2026-03-23T20:06:17.5866667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Follow these steps to enable and run a macro in Excel on Windows.

    1. Enable macros for the workbook
      1. Open the Excel file that contains the macro.
      2. If a yellow Security Warning bar appears under the ribbon, select Enable Content.
      3. In the Security Warning dialog, select Yes to make the document trusted. Macros are now enabled for this workbook.
    2. (If needed) Change macro settings in Trust Center
      1. Go to File > Options.
      2. Select Trust Center > Trust Center Settings….
      3. Select Macro Settings.
      4. Choose one of the safer options, for example Disable VBA macros with notification (recommended). This allows macros but shows a warning so they can be enabled per document.
      5. If the workbook uses Excel 4.0 (XLM) macros, check Enable Excel 4.0 macros when VBA macros are enabled so XLM macros follow the same settings.
      6. Select OK to close the Trust Center, then OK again.
      7. Close and reopen the workbook and select Enable Content when prompted.
    3. Run the macro from the Developer tab
      1. Open the workbook that contains the macro.
      2. On the Developer tab, select Macros.
      3. In the Macro name box, select the macro to run.
      4. Select Run.
      Optional actions in the Macros dialog:
      • Options – assign a shortcut key or description.
      • Step / Step Into – open the Visual Basic Editor and step through code line by line with F8.
      • Edit – open the Visual Basic Editor to modify the macro and run it with F5 from there.

    If the macro still does not run, verify that macro security is not set to “Disable all macros without notification” and that the workbook is either trusted or stored in a trusted location.


    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.