Macros can cause serious damage to your computer. It happens to erase files or install malware. Thus, users need to know about macro security in Excel. In addition to that, Microsoft has already added macro-security features to help prevent your working devices (computers or smartphones) from macro-related problems.
Go through the below sections to learn essential things about macro security. This article is part of my series: Excel VBA & Macros – A Step by Step Complete Guide.
Download Working File
This file contains a VBA Macro. When you open it, it will show a Security Warning.
3 Necessary Aspects to Know about Macro Security in Excel
As Excel Macros pose serious security concerns, you need to maintain certain codes of conduct while dealing with macros. The basic security measures are discussed below.
1. Disabling Macros with Notification
- The following figure shows the Macro Settings section of the Trust Center dialog box. Choose Developer > Code > Macro Security, to display the Trust Center dialog box.
- By default, Excel uses the Disable All Macros with Notification When this setting is selected, if you open a workbook that contains macros (and the file is not digitally “Signed“), the macros will be disabled, and Excel will display a Security Warning above the Formula bar.
Visit This Link to familiarize yourself with other Macro Settings options and their effects.
2. Enabling Macros After Security Warning
- If you are sure that the workbook comes from a trusted source, click the Enable Content button or go to File > Info > click Enable Editing. The macros, in the workbook, will be enabled. Excel will remember your decision. After enabling the macros, the next time you open that file, you will not see the Security Warning.
⧭Notes: If the Visual Basic (VB) Editor window is open when you open a workbook that contains VBA macros, Excel does not display the Security Warning above the Formula bar. Instead, it displays a dialog box with two buttons: Enable Macros and Disable Macros.
3. Assigning Specific Folders as Trusted Location
- You may prefer to designate one or more folders as “Trusted Locations”, rather than deal with individual workbooks. All the workbooks in a trusted location are opened without a macro warning.
- You can designate a folder as trusted by moving File > Options > Trust Center > Trust Center Settings > Trusted Locations > Add New Location.
- Microsoft Office Trusted Location window opens up. Click on Browse.
- Assign the desired location and tick the Subfolders of this location are also trusted then click OK.
We hope this article sheds enough light on the fundamental issues regarding Excel macro. Comment if you seek further clarification or have anything to add.
Do check out our awesome website, Exceldemy, to find interesting articles on Excel.