Macros can cause serious damage to your computer. It can erase files or install malware. Microsoft has added macro-security features to help prevent your working devices (computer or smartphones) from macro-related problems.
This article is part of my series: Excel VBA & Macros – A Step by Step Complete Guide.
Macro Security in Excel
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 option. 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.
If you are sure that the workbook comes from a trusted source, click the Enable Content button in the security warning area. 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.
Note: 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.
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 trusted folders in the Trusted Locations section of the Trust Center dialog box, shown in the following figure.
Download Working File
This file contains the VBA macro. When you will open it, it will show a Security Warning.
Happy Excelling 🙂