0
0
Excelspreadsheet~10 mins

Macro security settings in Excel - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to enable macros in Excel by setting the security level to low.

Excel
Application.AutomationSecurity = [1]
Drag options to blanks, or click blank then click option'
AmsoAutomationSecurityByUI
BmsoAutomationSecurityHigh
CmsoAutomationSecurityLow
DmsoAutomationSecurityForceDisable
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a high security level disables macros.
Using the wrong constant name causes errors.
2fill in blank
medium

Complete the code to check the current macro security setting in Excel.

Excel
currentSetting = Application.AutomationSecurity
If currentSetting = [1] Then
    MsgBox "Macros are enabled"
End If
Drag options to blanks, or click blank then click option'
AmsoAutomationSecurityLow
BmsoAutomationSecurityHigh
CmsoAutomationSecurityByUI
DmsoAutomationSecurityForceDisable
Attempts:
3 left
💡 Hint
Common Mistakes
Confusing high security with enabled macros.
Using an incorrect constant for comparison.
3fill in blank
hard

Fix the error in the code that disables all macros in Excel.

Excel
Application.AutomationSecurity = [1]
Drag options to blanks, or click blank then click option'
AmsoAutomationSecurityLow
BmsoAutomationSecurityForceDisable
CmsoAutomationSecurityHigh
DmsoAutomationSecurityByUI
Attempts:
3 left
💡 Hint
Common Mistakes
Using msoAutomationSecurityHigh disables macros but not forcefully.
Using low security enables macros instead of disabling.
4fill in blank
hard

Fill both blanks to set macro security to prompt the user before running macros.

Excel
Application.AutomationSecurity = [1]
MsgBox "Current security is set to " & [2]
Drag options to blanks, or click blank then click option'
AmsoAutomationSecurityByUI
BmsoAutomationSecurityLow
CmsoAutomationSecurityHigh
DmsoAutomationSecurityForceDisable
Attempts:
3 left
💡 Hint
Common Mistakes
Using low or high security constants instead of the prompt setting.
Displaying a different constant than the one set.
5fill in blank
hard

Fill all three blanks to create a VBA macro that sets macro security to high, checks it, and shows a message.

Excel
Sub SetHighSecurity()
    Application.AutomationSecurity = [1]
    Dim secLevel As Integer
    secLevel = Application.AutomationSecurity
    If secLevel = [2] Then
        MsgBox [3]
    End If
End Sub
Drag options to blanks, or click blank then click option'
AmsoAutomationSecurityLow
BmsoAutomationSecurityHigh
C"Macro security is set to High"
D"Macros are enabled"
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing low and high security constants.
Using a message that does not match the security level.