Share via

Macros disabled

FELICIA DORRUTHA STEENBERG 0 Reputation points
2026-05-06T11:36:09.6+00:00

how to enable macros to run previously coded VBA in Excel Developer

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

2 answers

Sort by: Most helpful
  1. Daniel-Vo 6,005 Reputation points Microsoft External Staff Moderator
    2026-05-06T12:33:59.0866667+00:00

    Dear @FELICIA DORRUTHA STEENBERG,

    I understand that you have an Excel workbook with written VBA macros. Right now, macros are disabled, so your VBA code won’t run.

    To better assistance, could you please confirm following information:

    • What exact message do you see in Excel?
    • What is the file extension: .xlsm / .xltm / .xlam / .xlsx?
    • Where is the file saved (local PC, OneDrive/SharePoint/Teams, network drive, or downloaded from email/web)?
    • When you go to File > Options > Trust Center > Trust Center Settings > Macro Settings, are the options clickable or greyed out?
    • Is this a school-managed Windows device (IT-managed) or your personal device signed in with a school account?

    In the meantime, I recommend as below:

    Step 1: Confirm macro-enabled file type

    If the file is not macro-enabled, have them save as: Excel Macro-Enabled Workbook (*.xlsm)

    Step 2: Enable Macros When Prompted

    Open the .xlsm file in Excel.

    If you see a Security Warning message at the top, click Enable Content.

    If you do not see this message, the file may be fully blocked by Windows.

    Step 3: Enable macros for this specific file

    If you see a Security Warning bar, select Enable Content and confirm making the document trusted.

    Step 4: Unblock the File in Windows

    Close Excel > Right‑click the .xlsm file > Properties

    On the General tab, look for an Unblock checkbox > Check Unblock > Apply and OK.

    Reopen the file in Excel and click Enable Content if prompted.

    Step 5: Use a Trusted Location

    Instead of enabling macros repeatedly, store the workbook in a Trusted Location: Open Excel > Go to File > Options > Trust Center > Select Trust Center Settings > Trusted Locations > Click Add new location and choose the folder containing the .xlsm file.

    User's image

    (Optional) Enable Subfolders are also trusted.

    Click OK, close Excel, and reopen the file.

    User's image

    Files opened from trusted locations will run macros without warnings.

    Not: If the Developer tab is missing, please enable it via: File > Options > Customize Ribbon > All Tab > check “Developer” > Choose ">> Add" > OK

    Please understand that the initial response does not always resolve the issue immediately. However, with your help and more detailed information, we can work together to find a solution.

    Your detailed response will help us diagnose and investigate the issue more efficiently. If I misunderstood what you’re looking for, feel free to let me know or share a screenshot. I’d be happy to help further!

    Thank you for your cooperation. I'm looking forward for 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?


  2. AI answer

    2026-05-06T11:36:20.8733333+00:00

    To run existing VBA code in Excel, macro security must allow macros for that workbook.

    1. Open Excel and the workbook that contains the VBA code.
    2. Go to File > Options.
    3. Select Trust Center, then click Trust Center Settings....
    4. Select Macro Settings.
    5. Choose one of these options:
      • Disable all macros with notification (recommended so Excel prompts to enable macros per file), or
      • Enable all macros (not recommended, potentially dangerous code can run) to allow all macros to run while working on your VBA (remember to change this back afterward).
    6. Click OK to close Trust Center, then OK again.
    7. Close and reopen the workbook. If using “Disable all macros with notification,” select Enable Content in the security warning bar so the VBA can run.

    If the Developer tab is not visible (needed to access and run macros directly):

    1. Go to File > Options > Customize Ribbon.
    2. Under Main Tabs, check Developer and click OK.
    3. On the Developer tab, use Macros to run your existing VBA procedures.

    Note: If the device is managed by a school or organization, an administrator might prevent changing macro settings.


    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.