Open In App

How to Enable Macros in Excel (2025): Step-by-Step Guide

Last Updated : 11 Apr, 2025
Comments
Improve
Suggest changes
Like Article
Like
Report

How to Activate Macros in Excel – Quick Steps

  1. Open the Excel workbook.
  2. Click Enable Content in the yellow security warning bar.
  3. Go to File > Options > Trust Center > Trust Center Settings > Macro Settings.
  4. Choose the desired macro setting (e.g., Enable All Macros for trusted files).
  5. Save the file as .xlsm to retain macros.

Macros in Excel allow you to automate repetitive tasks and improve productivity, but before you can use them, you need to make sure they’re properly enabled. Whether you’re working on a single project or using macros across multiple files, understanding the correct steps for enabling Excel macros is essential. In this guide, you’ll learn how to enable macros for a single workbook, adjust settings to allow macros across all documents, and create trusted locations to avoid security prompts. We’ll also cover how to enable macros in Excel on Mac, so no matter your setup, you can start activating macros in Excel with confidence and control.

Method 1: Enable Macros for a Single Workbook

When opening a workbook containing macros in Excel, you may encounter a yellow security warning bar indicating that macros are disabled due to default security settings. Follow these steps to temporarily enable macros for the individual session:

Step 1: Open the Workbook with Macros

  • Open the Excel file that contains the macros.
  • If the workbook contains VBA code or macros, Excel will detect them and display a security warning.

Step 2: Locate the Yellow Security Warning Bar

  • Once the workbook opens, look for a yellow security warning bar below the ribbon at the top of the screen.
  • The warning informs you that macros have been disabled for safety reasons.
  • The message typically says: Macros have been disabled or Some content has been disabled.
Enable Macros in Excel

Click on “Enable Content”

Step 3: Click “Enable Content”

  • To activate the macros, click the “Enable Content” button in the yellow security warning bar.
  • This will temporarily enable the macros for the current session, allowing them to execute until the workbook is closed.

Important: Clicking “Enable Content” does not mark the file as trusted for future sessions. The file will remain untrusted unless you adjust the security settings permanently.

Step 4: Confirm Macro Activation (If Prompted)

  • If the workbook contains advanced features like VBA code in the Visual Basic Editor (VBE), a Microsoft Excel Security Notice dialog box may appear.
  • The dialog will ask you to confirm whether you trust the macros:
    • “Enable Macros”: Click this if you trust the source and are confident that the macros are safe.
    • “Disable Macros”: Select this if you do not trust the file or want to avoid running macros.

If you are sure that the file is from a trusted source, select “Enable Macros” to proceed.

Enable Macros in Excel

Click on “Enable Macros”

Step 5: Use Macros with Caution

Once macros are enabled, they will function as intended, executing automated tasks, scripts, or custom functions.

Keep in mind:

  • The macros will only remain active for this session.
  • If you close and reopen the workbook, macros will be disabled again unless you adjust permanent security settings.

Method 2: Change Macro Settings for All Workbooks

If you want macros to be enabled by default in all your Excel workbooks, you need to modify the macro security settings in the Trust Center. This ensures that Excel automatically permits the execution of VBA code across all workbooks without prompting you to enable macros each time. Follow these steps to permanently enable macros in Excel for Windows, Mac, or Office 365:

Step 1: Open Excel and Access the File Tab

Start by opening Microsoft Excel. Click on the File tab located at the top-left corner of the Excel window.

image

Click on the File Tab

Step 2: Click on Options

In the File menu, scroll down and select Options. This opens the Excel Options dialog box where you can customize various settings for Excel.

image

Go to Files>> Select options

Step 3: Navigate to the Trust Center Settings

In the Excel Options window, look at the list on the left-hand side and select Trust Center. This is where Excel manages its security settings, including macros and other potentially unsafe content.

Once you’ve selected Trust Center, click on the Trust Center Settings button on the right side of the window. This opens a new window where you can modify security settings in detail.

Enable Macros in Excel

Click on “Trust Center Settings” >> Go to Trust Center

Step 4: Go to Macro Settings

In the Trust Center dialog box, select Macro Settings from the list on the left-hand side. This section controls how Excel handles macros and VBA code execution.

Step 5: Enable Macros

You will now see several options for macro security. To enable all macros by default, select the option Enable all macros (not recommended; potentially dangerous code can run). This option allows any macro in any Excel file to run without prompting you for confirmation.

Warning: Enabling this option can expose your computer to potentially harmful macros from untrusted sources. It’s only recommended if you are confident in the security of the files you work with regularly.

Enable Macros in Excel

Click “Ok”

Step 6: Confirm the Changes

After clicking OK, the macro settings will be updated, and macros will be enabled automatically in all your Excel workbooks by default.

This change will apply to any workbook you open in the future. There’s no need to manually enable macros for each session.

Note: The option you select in the Trust Center becomes the new default macro setting for all of your Excel files. Instead, if you only want to enable macros for specific workbooks, save them in a trusted location.

Method 3: Enable Macros for Trusted Locations

Follow these steps to enable macros for files stored in trusted locations:

Step 1: Set Trusted Locations

  • Go to File > Options > Trust Center > Trust Center Settings > Trusted Locations.
  • Add folders where you store files with macros.

Step 2: Enable All Macros for Files in Trusted Locations

  • Any Excel file saved in these folders will automatically enable macros without showing warnings.

How to Enable Macros in Excel on Mac

Folllow the below steps to Enbale Macros in Excel on Mac:

Step 1: Open Excel and Go to Preferences

Click Excel > Preferences in the top menu.

Step 2: Access Security & Privacy

In the Preferences window, click Security & Privacy.

Step 3: Adjust Macro Settings

  • Under the Macro Security section, choose your desired option:
  • Disable All Macros With Notification (recommended).
  • Enable All Macros (not recommended unless the source is trusted).

Step 4: Save Changes

Close the Preferences window. Macro settings will apply to all workbooks

Security Best Practices for Enabling Macros

Here are some essential security practices to follow when enabling macros in Excel:

  • Enable Macros Only for Trusted Files: Only enable macros for files from trusted sources to avoid malicious code.
  • Use Digitally Signed Macros: Trust macros signed by verified developers to reduce security risks.
  • Use Trusted Locations: Store macro-enabled files in folders marked as trusted locations.
  • Backup Your Data: Before running a macro, save a backup of your workbook to avoid accidental data loss.
  • Monitor Security Settings: Regularly review and update your macro settings in Excel.

Common Issues and Troubleshooting

Enabling macros in Excel can sometimes lead to issues, especially if security settings or file permissions are not properly configured. Below are some common problems and their solutions to help you resolve them effectively:

1. Why is the “Enable Content” Button Missing?

  • The file might already be in a trusted location, so macros are enabled automatically.
  • The macro may be blocked by system policies. Check with your IT administrator.

2. Why Are Macros Still Disabled After Enabling?

  • Ensure the workbook is saved as a Macro-Enabled Workbook (.xlsm).
  • Check if macros are disabled by group policy or antivirus software.

3. Can I Enable Macros Temporarily?

  • Yes, macros can be enabled temporarily for a single session by selecting Enable Content in the Security Warning banner.

Conclusion

Now that you know the different methods for enabling Excel macros, you can choose the option that best fits your workflow and security preferences. Whether you’re activating macros in Excel for just one workbook, changing default settings for all files, or working on a Mac, the process is straightforward once you know where to look. With macros enabled, you’re ready to automate tasks and streamline your work inside Excel more efficiently and effectively.



Next Article

Similar Reads