Complete the code to enable macros in Excel by setting the security level to low.
Application.AutomationSecurity = [1]Setting Application.AutomationSecurity to msoAutomationSecurityLow enables macros to run without prompts.
Complete the code to check the current macro security setting in Excel.
currentSetting = Application.AutomationSecurity If currentSetting = [1] Then MsgBox "Macros are enabled" End If
The msoAutomationSecurityLow setting means macros are enabled.
Fix the error in the code that disables all macros in Excel.
Application.AutomationSecurity = [1]msoAutomationSecurityHigh disables macros but not forcefully.To disable all macros, use msoAutomationSecurityForceDisable.
Fill both blanks to set macro security to prompt the user before running macros.
Application.AutomationSecurity = [1] MsgBox "Current security is set to " & [2]
Setting Application.AutomationSecurity to msoAutomationSecurityByUI makes Excel prompt the user before running macros. Displaying the same constant confirms the setting.
Fill all three blanks to create a VBA macro that sets macro security to high, checks it, and shows a message.
Sub SetHighSecurity()
Application.AutomationSecurity = [1]
Dim secLevel As Integer
secLevel = Application.AutomationSecurity
If secLevel = [2] Then
MsgBox [3]
End If
End SubThis macro sets the security to high, checks if it is high, and then shows a message confirming the setting.