Computer >> Computer tutorials >  >> Software >> Office

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

We prepared a sample dataset here with the First Names, Last Names, and Ages of six people.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

We want to copy a single cell from the dataset with this code.

Sub Copy_Range()
 Range(Selection, Selection.End(xlDown)).Select
 Selection.Copy
 ActiveCell.Offset(0, 4).Range("A1").Select
 ActiveSheet.Paste
End Sub

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

When we press F5 on the keyboard to run it, an error message pops up that states that the code is not enabled for the Excel file. Let’s see how to fix the issue.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

Fix 1 – Enable Macros for a Single Workbook in Excel

Case 1.1. Access via Security Warning

  • When you open the workbook, you will notice a Security Warning on the top of the Formula Bar.
  • Click on Enable Content to enable macros.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • You will get the following Microsoft Excel Security Notice if the Visual Basic Editor window is opened while opening the file.
  • Click on Enable Macros to access it.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

Case 1.2 – Turn Macros On with Backstage View

  • Go to the File tab.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Click on Info.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Select Enable Content under the Security Warning.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

Case 1.3 – Change the Settings in the Trust Center

  • Go to the File tab and select Options.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Select Trust Center in the Excel Options dialog box.
  • Click on Trust Center Settings.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Go to the Macro Settings in the Trust Center dialog box.
  • Check Disable VBA macros with notification.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Go to ActiveX Settings and select the option shown in the image below.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Press OK twice to close all the dialog boxes.

Case 1.4 – Establish Trusted Documents

  • Go to the File tab and select Options.
  • Select Trust Center Settings from the Trust Center tab in the Excel Options window.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Mark the Allow documents on a network to be trusted option in the Trusted Documents section.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Press OK twice.
  • If you need to roll back this feature, click on Clear in the Trusted Documents tab and close the window.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

Fix 2 – Allow Macros Permanently in Excel for All Workbooks

Case 2.1 – Apply Changes in the Trust Center

  • Select File and choose Options.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Select Trust Center and go to Trust Center Settings.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Go to the Macros Settings tab.
  • Check the Enable VBA macros option.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Press OK twice to close all the windows.

Read More: [Solved]: Macro Settings Greyed out in Excel

Case 2.2 – Create a Trusted Location

  • Select File and choose Options.
  • Go to Trust Center Settings from the Excel Options window.
  • Go to the Trusted Location section in the Trust Center window.
  • Click on Add new location.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Insert a folder in the Path section.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Type a description in the Description box to determine the trusted files easily.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Check the Subfolders of this location are also trusted option if you have any.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Press OK twice to close all the windows.
  • Repeat to add as many files as you want. Excel files in these folders will have Macros enabled.

Fix 3 – Turn on Macros for One Session

  • Go to the File tab.
  • Go to the Info section.
  • Select Advanced Options in the Security Warning.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Select the option Enable content for this session.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Press OK and you will be able to run the macro only for as long as Excel is open.

How to Disable Macros in Excel

  • Select File and go to Options.
  • Select Trust Center and go to Trust Center Settings.
  • Go to Macro Settings.
  • Select the option Disable VBA macros without notification.

Resolve Excel Macro Issues: 3 Proven Solutions to Get Macros Running

  • Press OK.

Things to Remember

  • You must save your Excel file as a Macro-Enabled Workbook to use VBA code in it.
  • Avoid giving consent to Enable all macros in the Trust Center window unless you’re sure of what you’re downloading. You might enable malware code.

Download the Practice Workbook

Related Articles

  • [Fixed] Excel Macros Enabled But Not Working
  • [Fixed!]: Unable to Enable Macros in Excel
  • [Solve:] Cannot Edit a Macro on a Hidden Workbook
  • Excel Macro Security
Get FREE Advanced Excel Exercises with Solutions!