Macro Security in Excel VBA is provided to secure your data or PC from others or from the malicious programs. Learn more about macro security here.

Understanding Macro Security

It is important to understand the macro security if you are dealing with the Macro Enabled Files. It helps to protect your data from the malicious programs and helps to know how to run the macros when its required.

You can change the security level by clicking on the ‘Macro Security in Excel VBA’ button in the ‘Developer’ Tab of the Excel Ribbon.
vba-security-1

What Have Different Levels of the Security in VBA?

If you click on the ‘Macro Security’ button, it will open the Trust Center dialog, you can see the four levels of security in the dialog box:
Macro Security in Excel VBA-2

Security levelDescription
Disable all macros without notificationAll macros will be disabled.
Disable all macros with notificationWhen you open a file all the macros will be disabled, but it will be prompted with a message allowing you to enable them each time. This is the recommended option, since you can if you trust the macro file.
Disable all macros except digitally signed macrosYou won’t be able to run any macros unless they have a trusted digital certificate attached.
Enable all macrosAll macros will be Enabled as soon as a file is opened. This is not recommended

Macro Security in Excel VBA – How to Enable or Disable the Macros?

When you open any macro enabled file, if you have chosen the option “Disable all macros with notification” in the Macro Security Settings. It will prompt for enabling or disabling the macros. If you trust the file you can Enable it or else disable the file.

vba-security-3

Note: Macro security is very crucial while dealing with Excel VBA macro files. If you are opening a file from unknown person, it is better to disable the macros.

Hey! Join Our Community

Get Quick Responses & Experts' Answers in Minutes!
Get Notified - When Answered Your Question!