How to Enable Macros in Excel?

Enabling macros in Microsoft Excel is a crucial skill for anyone who wants to take full advantage of the software’s capabilities. Macros are small programs written in Visual Basic for Applications (VBA) that perform repetitive tasks or complex operations with a single command, saving you time and effort. However, because macros can contain harmful code, Excel has security features that regulate their use. In this blog post, we’ll walk you through the steps to enable macros in Excel, ensuring you can use them safely and effectively.

What is a Macro in Excel?

A macro in Excel is a set of programmed instructions created to automate repetitive tasks. These instructions are written in Visual Basic for Applications (VBA), Excel’s programming language. Macros can range from simple commands, like inserting your name into a spreadsheet cell, to more complex operations, such as processing large amounts of data or custom calculations, all with the click of a button. Essentially, macros serve as productivity tools, enabling users to save time on routine tasks and enhance efficiency in data processing and report generation.

Benefits of Using Macros?

Using macros in Excel brings a multitude of benefits, especially for users looking to automate repetitive tasks, enhance productivity, and streamline complex processes. Here are some of the key advantages of using macros:

  1. Time Savings and Efficiency: Macros automate repetitive and time-consuming tasks, such as data entry, formatting, or calculations, saving hours of manual work and increasing overall efficiency.
  2. Consistency and Accuracy: By automating tasks, macros ensure that actions are performed consistently every time, reducing human errors and increasing the accuracy of your data and reports.
  3. Enhanced Data Analysis and Reporting: Macros can be used to perform complex data analysis and generate reports quickly. They can sift through large datasets, perform calculations, and create summaries or visualizations, aiding in more informed decision-making.
  4. Customization and Flexibility: With macros, you can tailor Excel to meet your specific needs. Whether it’s a custom function that isn’t available in Excel by default or a complex workflow specific to your work, macros offer the flexibility to create personalized solutions.
  5. Improved Workflow and Productivity: Macros can link together multiple processes into a single step, streamlining workflows. For example, you can create a macro that cleans data, performs calculations, and generates a report with the press of a button.
  6. Skill Development and Professional Growth: Learning to write and implement macros in Excel can significantly boost your technical skills, making you more valuable in the job market. Proficiency in macros and VBA programming opens up new opportunities for process improvement and automation in various industries.
  7. Cross-Application Automation: Excel macros can interact not just within Excel but also with other applications in the Microsoft Office suite, such as Word and PowerPoint, allowing for automation that spans across applications. For instance, you could automate the generation of a PowerPoint presentation based on Excel data analysis.
  8. Scalability: Macros make scaling up processes more manageable. What starts as a macro for a small dataset can easily be adapted to handle much larger amounts of data or more complex analysis, supporting growth without a proportional increase in effort.
  9. Error Reduction: Automated processes reduce the likelihood of errors that can occur with manual data entry or manipulation, leading to more reliable outcomes and data integrity.
  10. Enhanced Collaboration: Sharing macro-enabled workbooks with colleagues can help standardize processes across a team or organization, ensuring that everyone follows the same procedures and formats, which enhances collaboration and efficiency.

In summary, macros in Excel are a powerful tool for anyone looking to automate their work, improve efficiency, and reduce errors. Whether you’re a data analyst, a financial professional, or someone who regularly works with large datasets, learning to effectively use macros can significantly enhance your capabilities in Excel.

Why Do We Need to Enable Macros?

Macros are disabled by default in Excel Application due to potential security issues can be caused by VBA codes. You need to enable Macros in order to run the Macros in the trusted Excel Files. You Enabling macros is essential for several reasons:

  • Automation of Repetitive Tasks: Macros automate tasks that would otherwise require extensive manual input, saving time and minimizing errors.
  • Complex Data Processing: They can handle complex calculations and data processing tasks, making it easier to manage and analyze large datasets.
  • Custom Functionality: Macros offer the ability to customize Excel functionality to suit specific needs, extending beyond the built-in features of the software.
  • Integration with Other Office Applications: Through macros, Excel can interact with other Microsoft Office applications like Word and PowerPoint, facilitating seamless data and information flow between them.

However, due to the powerful nature of macros and their ability to execute commands automatically, they can also pose security risks if malicious code is executed. This is why Excel has built-in security features to regulate macro usage, requiring users to enable macros explicitly.

Why Enabling Macros is Dangerous?

Enabling macros in Excel carries potential risks primarily because macros can run a series of actions automatically, including operations that can affect your system beyond Excel. While macros are incredibly powerful and useful for automating tasks and enhancing productivity, this same power can be exploited for malicious purposes. Here are the key reasons why enabling macros can be dangerous:

  1. Malware and Viruses: Macros can be used to write or distribute malware, including viruses and ransomware. An infected Excel document, once opened and macros enabled, can execute malicious code designed to harm your computer, steal sensitive information, or encrypt files for ransom.
  2. Automatic Execution of Harmful Operations: Malicious macros can perform a wide range of harmful operations without the user’s knowledge, such as deleting files, sending private information over the internet, downloading additional malware, or installing keyloggers to capture passwords and other sensitive data.
  3. Phishing Attacks: Cybercriminals often use macros as part of phishing attacks. They might send an email with an attached Excel file claiming to be important information requiring immediate attention. Once the macro is enabled, it can launch a script that attempts to steal personal information or login credentials.
  4. Security Vulnerabilities: Macros can exploit vulnerabilities within Excel or the wider operating system. Even if a macro isn’t inherently malicious, it might inadvertently create security vulnerabilities that can be exploited by other malware.
  5. Lack of Visibility: Once a macro is running, it’s often difficult to see what it’s doing until it’s too late. Unlike manual operations, where each step is visible and reversible, macros can execute a series of complex operations instantly and without user interaction, making it hard to stop malicious actions once they start.
  6. Spread and Impact: A macro virus can spread to other documents and systems, especially in networked environments or where files are frequently shared between users. This can lead to widespread impact within an organization, affecting not just a single user but potentially compromising entire systems.

Mitigation Strategies:

To mitigate these risks, it’s essential to:

  • Only enable macros from trusted sources.
  • Keep your software and security tools up to date to protect against known vulnerabilities.
  • Use digital signatures to verify the integrity and origin of macros.
  • Maintain strict security settings in Excel, preferring settings that disable all macros without notification or only allow digitally signed macros.
  • Educate users about the risks of macros and safe practices for using them, especially in organizational settings.

By understanding these dangers and implementing safety measures, users can leverage the power of Excel macros while minimizing the potential risks.

Understanding Excel Macro Security Settings

Before we dive into enabling macros, it’s essential to understand the different security settings available in Excel. The Macro Settings within the Trust Center offer 4 distinct options to control how macros are handled. These settings are designed to balance between usability and security, providing users with the flexibility to choose the level of precaution that best suits their needs. Here’s a breakdown of each option:

Excel Macro Security Settings

1. Disable all macros without notification

This setting blocks all macros from running in Excel, and no notifications or warnings are provided when a workbook containing macros is opened. It’s the most secure setting, recommended if you rarely use macros and want to ensure maximum protection against potentially malicious code.

  • Use Case: Ideal for users who prioritize security and do not need to run macros regularly. It prevents any risk of macro-based malware but can be inconvenient if you frequently work with legitimate macros.

2. Disable all macros with notification

Macros are disabled, but you receive a security warning when opening a workbook that contains macros. You have the option to enable the macros for that session. This setting offers a good balance between security and functionality, allowing users to decide on a case-by-case basis.

  • Use Case: Suitable for most users who occasionally use macros. It provides a level of security by default while offering the flexibility to enable macros for trusted documents.

3. Disable all macros except digitally signed macros

Only macros that are digitally signed by a trusted publisher can run. Any unsigned macros are automatically disabled without notification. This setting enables a higher level of trust, as digitally signed macros include an identifier that verifies the source as trustworthy.

  • Use Case: Best for users who use macros from known, reliable sources. It ensures that only macros from trusted publishers, which have been verified through a digital signature, are allowed to run.

4. Enable all macros (not recommended; potentially dangerous code can run)

All macros will run automatically without any warnings or restrictions. This setting offers the highest level of convenience for running macros but poses a significant security risk, as it could allow malicious macros to run.

  • Use Case: Although not recommended due to the risk of malware, this setting might be used in highly controlled environments where macros are extensively used, and all macro sources are known and trusted.

Each of these settings serves different needs, from maximum security (disable all without notification) to ease of use (enable all macros), with options in between that provide varying degrees of security and convenience. It’s crucial to choose the setting that aligns with your security concerns and how you use macros in Excel.

Simple Steps to Enable Macros in Excel

Below are the different approaches to Enable Macros in Excel. You can Enable macros for Individual Excel File, All Files, or Files stored in a specific folder.

Enabling Macros For Individual Excel Workbooks

Enabling Macros For Individual Excel Workbooks:

When you open any Macro Enabled Excel File (.xlsm), Excel Application displace a security warning message at the bottom of ribbon menu. You can enable the macros by clicking on the ‘Enable Content’ button if you trust the Source File. Follow the below steps to enable macros for individual Excel Macro File.

  1. Open your Excel document: Start by opening the Excel file that contains the macros you want to use.
  2. Security Warning: If your Excel security settings are set to disable macros with notification, you’ll see a security warning bar beneath the ribbon. It will say “Security Warning Macros have been disabled.”
  3. Enable Content: Click on the “Enable Content” button in the security warning bar. This action will enable macros for the current session only. When you close and reopen the document, you’ll need to enable macros again if the security settings haven’t been changed permanently.

Enable Macros For Multiple Files:

Alternatively, you can Enable the macros for Multiple Files based on your requirement. You can Enable All Files, or files stored in a specific Folder by changing Macro Security Settings . Follow these steps for Enabling Macros for multiple Files.

  1. Access the Trust Center:
    • In Excel, go to the File tab, then click on Options at the bottom.
    • In the Excel Options dialog box, select Trust Center on the left sidebar, then click on the Trust Center Settings button.
  2. Macro Settings:
    • In the Trust Center dialog box, select Macro Settings on the left sidebar.
    • Choose the macro setting you prefer. For general use, “Disable all macros with notification” is a recommended choice for balancing security and functionality.
  3. Digitally Signed Macros:
    • If you only want to allow digitally signed macros, select “Disable all macros except digitally signed macros.” This ensures you only run macros from trusted sources.
    • Digitally Signed Macros:
  4. Enable All Macros (Not Recommended):
    1. If you only want to Enable All Macros, select the 4th option (Enable All Macros) All macros will run automatically without any warnings or restrictions.
    2. Please note that this option is not recommended as it can put your PC in high risk, only use when you have all files from trusted source.
  5. Apply Changes: After selecting your desired setting, click OK to apply the changes and close the dialog boxes.

Best Practices for Using Macros

Implementing best practices for using macros in Excel is essential for both maximizing productivity and safeguarding against potential security risks. Macros can automate tasks and process data efficiently, but they can also pose a security risk if not used cautiously. Here are some guidelines to ensure safe and effective macro use:

1. Use Macros from Trusted Sources

  • Verify the Source: Only use macros from reliable and trusted sources. If you download a macro-enabled workbook from the internet, ensure it’s from a reputable website or author.
  • Understand the Code: If possible, review the macro code (VBA) to understand what it does before running it. This is especially important for macros obtained from less familiar sources.

2. Enable Macros Temporarily

  • Enable for Single Use: Consider enabling macros on a session-by-session basis rather than changing your global settings to always allow macros. This reduces risks while still allowing flexibility.

3. Regularly Update Security Software

  • Anti-virus and Anti-malware: Ensure your security software is up to date. This software can help protect your system from malicious code that might be executed through macros.
  • Update Excel: Regularly updating Excel ensures you have the latest security features and fixes that can protect against vulnerabilities exploited by malicious macros.

4. Implement Digital Signatures

  • Use Digitally Signed Macros: Whenever possible, use macros that are digitally signed with a certificate from a trusted source. This adds a layer of verification that the macro hasn’t been tampered with and comes from a secure origin.
  • Become a Trusted Publisher: For organizations, becoming a trusted publisher and digitally signing your macros can streamline workflow and ensure security within your macro-enabled documents.

5. Back Up Important Data

  • Regular Backups: Before running any macro, especially one that will perform large-scale changes, ensure you have a recent backup of your data. This practice can prevent data loss in case the macro does not work as expected.

6. Use Macro Security Settings Wisely

  • Configure Security Settings: Familiarize yourself with Excel’s macro security settings and choose the one that best fits your needs, typically “Disable all macros with notification.” This setting allows you to decide when to enable macros.
  • Restrict Access: In a work environment, consider using Group Policy settings to manage macro settings for all users, restricting who can enable macros and under what circumstances.

7. Educate and Train Users

  • Awareness: If you’re in an organizational setting, ensure that all users who may interact with macros understand the risks and are trained on how to use them safely.
  • Policy Development: Develop and disseminate clear policies on macro use, including guidelines on when and how to enable them, to ensure everyone understands their responsibilities.

8. Monitor and Review Macro Use

  • Audit and Logs: Keep an eye on macro usage, especially in a business environment. Use audit logs if available to track who is running macros and on what documents, helping to identify suspicious activities.

By adhering to these best practices, you can enjoy the productivity benefits of Excel macros while minimizing the risks associated with their use.


The FAQs section provides concise answers to a wide range of common questions, from basic queries about enabling macros in various Excel versions and environments, such as Windows 10, Excel 365, and Mac, to more intricate issues like troubleshooting non-working macros or ensuring macros are safe to use. Whether you’re a beginner seeking to understand the basics or an experienced user looking for advanced tips, this section aims to equip you with the knowledge and tools necessary to effectively manage macros, enhance your productivity, and safeguard your data within Excel.

How to Enable Macros in Excel for an Individual Session?

  1. Open your Excel workbook.
  2. If the workbook contains macros, you’ll see a security warning bar beneath the ribbon saying “Security Warning: Macros have been disabled.”
  3. Click on “Enable Content” on the security warning bar to enable macros just for the current session.

How to Enable Macros in Excel Permanently?

To permanently enable macros for all future documents (which is not recommended due to security risks), follow these steps:

  1. Go to File > Options.
  2. In the Excel Options dialog box, click on Trust Center, then click on Trust Center Settings.
  3. In the Trust Center, select Macro Settings.
  4. Choose “Enable all macros (not recommended; potentially dangerous code can run)” and click OK.
  5. Click OK again in the Excel Options dialog to apply your changes.

How to Change Macro Settings in Excel?

  1. Go to File > Options.
  2. Select Trust Center and then Trust Center Settings.
  3. Choose Macro Settings on the left.
  4. Select your preferred macro security setting, such as “Disable all macros with notification.”
  5. Click OK to apply changes.

Are Macros Safe?

Macros can be safe if used correctly and sourced from trusted origins. However, they can also pose a security risk if they contain malicious code. Always use macros from reliable sources and maintain appropriate security settings in Excel.

What is the Shortcut to Enable Macros?

There is no direct shortcut to enable macros due to security considerations. You must manually enable them through the security warning bar or change the macro settings in the Trust Center.

Why Macro is Not Working in Excel?

Several reasons could cause a macro not to work:

  • Macros are disabled in your security settings.
  • The macro uses features not supported by your version of Excel.
  • There are errors in the macro code.

Why Are My Macros Not Showing Up?

If your macros are not showing up:

  • They may have been saved in a workbook format that doesn’t support macros, such as .xlsx instead of .xlsm or .xlsb.
  • Macro security settings may be preventing them from being displayed or run.

How to Enable Macros in Excel Windows 10 & Windows 11?

The process for enabling macros in Excel is the same for Windows 10 and Windows 11:

  1. Open Excel and your document.
  2. Click “Enable Content” in the security warning, or change the macro settings in the Trust Center as described above.

How to Enable Macros in Excel 2007, 2013, 2016, and 365?

For Excel 2007, 2013, 2016, and 365 on Windows:

  1. Go to the Microsoft Office Button or File tab, then click Excel Options.
  2. Click Trust Center, then Trust Center Settings, and then Macro Settings.
  3. Choose your desired settings and click OK.

How to Enable Macros in Excel on Mobile?

Enabling macros on Excel’s mobile version is not supported due to security and functionality limitations.

How to Enable Macros in Excel on Mac?

  1. Go to Excel > Preferences.
  2. Under Authoring, select Security & Privacy.
  3. Choose the macro settings under “Macro Security” to adjust how you want macros to be handled.

By understanding these sections and FAQs, you’re now equipped to manage macros in Excel more effectively, enhancing productivity while maintaining security.

Can I Enable Macros in a Shared Workbook?

  • Enabling macros in a shared workbook can be complex because shared workbooks often have limited functionality. Before sharing, ensure macros are necessary for the workbook’s purpose and consider alternative collaboration tools like Excel Online for Office 365/Excel for Microsoft 365 if macro functionality is critical.

How Do I Know if a Macro is Safe to Enable?

  • Verify the source of the macro or the workbook containing it. Trusted sources include well-known companies or developers with a reputation for safety.
  • Look for a digital signature. A macro digitally signed by a reputable source can generally be considered safe.
  • Consider scanning the file with antivirus software before opening.

How to Enable Macros in Excel for a Specific Workbook?

  • To permanently enable macros for a specific workbook without changing the global settings, you can’t directly within Excel due to security restrictions. However, you can sign the macro with a digital certificate, making it a trusted document, or adjust the Trust Center settings to enable all macros when working with that specific workbook and remember to switch back afterwards.

How to Create a Digital Signature for My Macros?

  • You can create a digital signature using a certificate issued by a commercial certificate authority (CA) or create a self-signed certificate using the Selfcert.exe tool included with Office.
  • After creating a certificate, sign your VBA project in Excel through the Developer tab, under the VBA Project properties.

What to Do if Excel Macros are Enabled but Still Not Working?

  • Ensure the workbook is saved in a macro-enabled format (.xlsm or .xlsb).
  • Check if the macro is written correctly and compatible with your version of Excel.
  • Make sure the macro is stored in a location Excel considers safe, like a Trusted Documents folder or a location specified in the Trust Center.

How to Recover Lost or Deleted Macros in Excel?

  • If you’ve accidentally deleted a macro, you might be able to recover it by reverting to a previously saved version of the workbook.
  • Use file recovery tools or check if there’s a backup copy of the workbook.
  • Going forward, consider regularly backing up important Excel files, including those with macros.

How to Share Excel Macros with Others?

  • The simplest way is to share the macro-enabled Excel workbook (.xlsm or .xlsb).
  • For more advanced users, you can export the macro module from the VBA editor and share the exported file. The recipient can then import it into their Excel VBA editor.

How to Run a Macro Automatically When Opening an Excel Workbook?

  • You can use the Workbook_Open() event in the ThisWorkbook module in the VBA editor to run a macro automatically when the workbook is opened. However, macro settings might prevent this from running without user consent.

How to Enable Macros in Read-Only Workbooks?

  • Macros can be enabled in read-only workbooks by clicking “Enable Content” for the session. However, saving changes, including those made by macros, requires saving the workbook with a new name or obtaining write access.

Why Do I Get an Error Message When Trying to Enable Macros?

  • Cause: This can occur if the macro is not digitally signed, or the security settings in Excel are set to disable all macros without notification.
  • Solution: Check your macro security settings and adjust them to allow macros with notification, or ensure the macro is digitally signed by a trusted publisher.

How to Fix “Cannot Run the Macro…” Error in Excel?

  • Cause: This error typically appears if the macro is not available or has been disabled in the current workbook or Excel settings.
  • Solution: Ensure the macro exists in the workbook and is correctly named. Adjust your macro security settings to allow the macro to run, and check if the workbook is saved in a macro-enabled format (.xlsm or .xlsb).

What to Do If Macros Are Enabled but Not Working?

  • Cause: This might be due to macros being stored in a location that Excel does not recognize as safe, or the VBA code contains errors.
  • Solution: Store your macro-enabled workbook in a Trusted Location, as defined in the Trust Center settings. Additionally, review the VBA code for any errors or compatibility issues with your version of Excel.

How to Resolve “The Macro May Not Be Available in This Workbook” Error?

  • Cause: This error occurs if the macro is in a different workbook that isn’t open or if Excel cannot find the macro due to naming or location issues.
  • Solution: Make sure the workbook containing the macro is open and the macro name is spelled correctly. If the macro is intended to be used across workbooks, consider storing it in the Personal Macro Workbook or a module that’s accessible.

Why Am I Seeing “Macro Settings Are Disabled” Message Even After Enabling Them?

  • Cause: This could be due to Excel not recognizing changes to the Trust Center settings, or group policy settings (in a managed IT environment) overriding individual settings.
  • Solution: Restart Excel to ensure any changes to the Trust Center settings are applied. In a managed IT environment, you may need to consult with your IT department to adjust group policy settings.

How Can I Fix Macros Not Running on a Networked or Shared Drive?

  • Cause: Macros stored on networked or shared drives may not run due to Excel’s security settings, which are designed to protect against potentially unsafe macros from the internet or other network locations.
  • Solution: Add the network or shared drive location to the Trusted Locations list in the Trust Center settings. Ensure network policies or firewall settings do not block the execution of macros.


In conclusion, mastering the use of macros in Excel can significantly enhance your productivity by automating repetitive tasks and enabling complex data processing. We’ve explored how to enable macros, both for individual sessions and permanently, as well as how to adjust macro security settings to ensure a balance between functionality and security. Through this comprehensive guide, you’ve learned not only the practical steps of managing macros but also the importance of exercising caution to keep your data safe.

Macros are powerful tools in Excel, but their safety and efficacy largely depend on the user’s understanding and practices. By following the best practices outlined—such as using macros from trusted sources, keeping software up to date, and regularly backing up important data—you can leverage the full potential of macros while mitigating the risks involved.

Additionally, we addressed a variety of FAQs to help you navigate common concerns and issues, from enabling macros in different Excel versions and platforms to troubleshooting and sharing macros. This information serves as a valuable resource for both novice and experienced Excel users alike, ensuring you can work with macros confidently and securely.

Remember, the key to successfully using macros lies in understanding their capabilities and limitations, maintaining stringent security practices, and continually learning and adapting to new Excel features and best practices. With this knowledge, you’re well-equipped to use Excel macros to their full advantage, streamlining your workflows and achieving greater efficiency in your tasks.

Whether you’re automating simple tasks or implementing complex data analysis routines, the power of Excel macros is at your fingertips. Use it wisely, and watch your productivity soar.

Share This Story, Choose Your Platform!

Leave A Comment