5 Ways to Enable Macros in Microsoft Excel

Today you’ll learn how to enable macros in Microsoft Excel in proven ways.

If you’re a power user of Microsoft Excel, you must be using Excel VBA macros to automate tasks. However, not always this feature is active on your Excel desktop app.

Excel VBA macros come with certain security risks so this feature might be turned off. Here you can use your Excel skills to enable macros for automation purposes.

Let’s look into those methods below!

Using the Security Warning Bar

Often Excel workbooks containing macros will be blocked from running script as for security reasons the spreadsheet app doesn’t allow macros in Excel for a new workbook.

Enable Content
Enable Content

When you open an Excel file that contains active content, like a macro, you get the notification message as shown in the above image.

The notification clearly says the following:

Macros have been disabled. Enable Content.

You can click on the Enable Content button to activate the existing macro in the Excel workbook.

📒 Read More: 7 Ways to Disable Macros in Microsoft Excel

From the Trust Center Settings

You can always customize how the Excel desktop app responds to workbooks that come with preinstalled VBA macros. If you trust the source all the time you can probably change the Trust Center Settings to disable the automatic blocks imposed on Excel files with macros.

Microsoft Excel Trust Center
Microsoft Excel Trust Center

Open your Excel worksheet and press Alt + F + T to open the Excel Options dialog box.

Click on the Trust Center option in the left-side navigation panel of Excel Options.

Now, select the Trust Center Settings button on the right side below the Microsoft Excel Trust Center section.

Enable all macros
Enable all macros

On the Trust Center dialog box, click on the Macro Settings option on the left side.

The Trust Center options for Excel VBA macros will open on the right side.

There, you’ll see the following four options:

  • Disable all macros without notification: Blocks all macros from running without any warnings.
  • Disable all macros with notification: Disable macros but show a prompt, allowing you to enable them when needed.
  • Disable all macros except digitally signed macros: Blocks all macros except those signed by a trusted publisher.
  • Enable all macros (not recommended, potentially dangerous code can run): Allows all macros to run without restriction.

You can choose Enable all macros since you’re confident that you’ll be accessing only those Excel workbooks forwarded through the work or school domains and already security checked by Microsoft Defender for Office 365. Specifically, the Safe Attachments and Safe Links features help detect and block harmful macros, malicious scripts, and embedded threats in shared files.

From now on, whenever you open any Excel workbook containing a macro, the app won’t block it.

⚠️ Warning: It’s, however, highly suggested that you shouldn’t set the Enable all macros feature just to be on the safe side.

Enable for a Trusted Location and Documents

You can customize the security settings in your Excel desktop app to allow Excel workbooks with macros from a specific set of local and network storage and documents. These settings are more reliable than completely allowing all VBA macro-based Excel workbooks.

Disable all macros with the notification
Disable all macros with the notification

Firstly, enable Disable all macros with the notification option from Excel Options > Trust Center > Trust Center Settings > Macro Settings.

Block all sign-in prompts
Block all sign-in prompts

Now, stay on the Trust Center dialog box and go to the Form-based Sign-in menu.

Ensure the Block all sign-in prompts option has been selected under the Sign-in Prompt Behavior section.

Now that your Excel desktop app has been secured from executing unauthorized Excel VBA macros, let me walk you through the process to enable certain storage and document settings to enable macros in Excel.

Add new location
Add new location

Considering you’re still in Excel Options > Trust Center > Trust Center Settings dialog box, click on the Trusted Locations option.

On the right side, you’ll see the Trusted Locations section with a list of Excel workbook sources from which the Excel desktop app will allow all workbooks containing active content, like macros.

Click on the Add new location button.

Microsoft Office Trusted Location
Microsoft Office Trusted Location

The Microsoft Office Trusted Location dialog box will open. Click on the Browse button and navigate to the Excel workbook storage source that you want the Excel desktop app to trust all the time.

Click OK to save the changes you’ve made.

Allow documents on a network to be trusted
Allow documents on a network to be trusted

Now, click on the Trusted Documents option in the left-side navigation panel.

Checkmark the checkbox for Allow documents on a network to be trusted option.

Click OK to save the setting modification.

From now on, it’ll become easier for you to open and run macros in Excel without bumping into unnecessary security protocols, like Excel blindly blocking all active elements, like Excel VBA macros.

Enable Macros Via the Developer Tab

You can also enable the Developer tab and use it to activate Excel VBA macros on your Excel desktop app.

Developer option
Developer option

Firstly, if you don’t see the Developer tab in the Excel ribbon menu, press Alt + F + T to launch the Excel Options tool.

Click on the Customize Ribbon option on the left side navigation panel.

Look for the Developer checkbox below the Main Tabs column.

Checkmark the checkbox and click OK at the bottom of the Excel Options dialog box to save this modification.

You’ll now see the Developer tab on the Excel ribbon menu.

Macro Security
Macro Security

Click on the Developer tab and find the Macro Security command in the Code block.

Select the Macro Security command to open the Trust Center dialog box.

There, you’ll see the Macro Settings section.

Select the Enable VBA macros option from this section and click OK to save this change.

From now on, whenever you try to open any Excel workbook with a macro, Excel won’t block the content. You can run the macro if you trust it by accessing the Macro dialog box by pressing Alt + F8 keys on the keyboard.

Enable Macros in a Specific Workbook

To enable macros in a specific workbook, follow these steps:

The Workbook Shows a Security Warning

Open the Excel workbook that contains macros.

Look for a yellow bar at the top with a security warning.

Click the Enable Content button to allow macros for this session.

If you’re concerned about system security all the time and not bothered with the Enable Content warning sign, you can keep this setting as is for this specific Excel workbook.

Always Enable Macros for This Workbook

You can also use the Security Warning tool in an Excel workbook to customize how Excel should act when it detects active content, like VBA macros in specific Excel files.

Advanced Options
Advanced Options

Open an Excel workbook that contains macros or you wish to add macros to that and want to configure the security settings in advance.

Press Alt + F + I to access the Excel backstage Info screen.

Click on the Security Warning option.

A drop-down context menu will open. Click on the Advanced Options from that menu.

Enable content for this session
Enable content for this session

The Microsoft Office Security Options dialog box will open.

Choose the Enable content for this session option and click OK.

Now, click on the Open the Trust Center hyperlink at the bottom of the Microsoft Office Security Options dialog box.

Trusted Locations option
Trusted Locations option

You’ll see the Trust Center tool.

Navigate to the Trusted Locations option on the Trust Center tool and find out the locations that are by default or have been manually set as trusted on the PC.

Move this specific Excel workbook into any of these trusted locations.

Next time on, whenever you access the same Excel workbook, irrespective of the global active content settings in your Excel desktop app, this workbook won’t block the macros.

Enable Macros in Excel Online

Unfortunately, Excel VBA macros won’t work in Excel for the web and Excel online web apps. That’s because Microsoft hasn’t made the web edition of the Excel spreadsheet tool compatible with running VBA scripts.

If you must enable and run VBA macros in an Excel spreadsheet created on Excel for the web, you can try any of these workarounds:

Download the File to Run Locally

Open the Excel workbook using Excel for the web app.

Download a Copy
Download a Copy

Click on the File tab and hover the mouse cursor over the Create a Copy option.

An overflow menu will open on the right side of the existing context menu.

There, you should see the Download a Copy option. Click on that.

The workbook will be downloaded on your PC.

You can now open it using Excel for the Microsoft 365 desktop app and enable macros by following any of the methods explained so far.

Use Office Scripts

Since Excel VBA-based automation isn’t possible in Excel for the web app, Microsoft added the Office Scripts feature so you can use scripting in Excel online. However, this feature is only available to Excel online users who’ve got Business Standard or better Microsoft 365 subscriptions.

Use Office Scripts
Use Office Scripts

Click on the Automate tab in the Excel ribbon menu. This tab will only be available if you’re using a supported Microsoft 365 subscription.

Now, select the New Script option and the Office Scripts Code Editor navigation panel will open on the right side as a sidebar.

📚 Read more: If you’ve learned something new from this Excel tutorial, you’ll also want to go through these Excel guides to enhance your Excel skills:

Conclusions

So far, you’ve learned five different ways to enable macros in Microsoft Excel. You’ve also learned how to modify Excel’s default actions when it comes to opening or allowing active content, like VBA scripts in your Excel workbooks.

Furthermore, you’ve learned that the Excel for the web app doesn’t allow any VBA scripts so you must follow any of the two workarounds shown in this Excel guide.

Did this Excel tutorial help you learn new skills to navigate the macros feature appropriately? You can share your thoughts by writing in the comment box.

About the Author

Bipasha Nath

Bipasha Nath

Bipasha is a technical content writer with 10+ years of experience in the technology industry. She previously worked in a SaaS software development company focused on SharePoint, OneDrive, Word, Excel, Word solutions.

Related Posts

Comments

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Get the Latest Microsoft Excel Tips

Follow Us

Follow us to stay up to date with the latest in Microsoft Excel!

Subscribe for awesome Microsoft Excel videos 😃