Open in the explorer

Automation Security

Type
User
GPO path
User Configuration › Policies › Administrative Templates › Microsoft Office 2016 › Security Settings
Supported on
At least Windows Server 2008 R2 or Windows 7
ADMX file
office16.admx
Internal name
office16/L_AutomationSecurity

Explanation

This policy setting controls whether macros can run in an Office 2016 application that is opened programmatically by another application.

If you enable this policy setting, you can choose from three options for controlling macro behavior in Excel, PowerPoint, and Word when the application is opened programmatically:

- Disable macros by default - All macros are disabled in the programmatically opened application.

- Macros enabled (default) - Macros can run in the programmatically opened application. This option enforces the default configuration in Excel, PowerPoint, and Word.

- User application macro security level - Macro functionality is determined by the setting in the "Macro Settings" section of the Trust Center.

If you disable or do not configure this policy setting, when a separate program is used to launch Microsoft Excel, PowerPoint, or Word programmatically, any macros can run in the programmatically opened application without being blocked.

Registry

HKEY_CURRENT_USER\software\policies\microsoft\office\common\security
Value name
not defined in the ADMX

Enable / disable values: not defined in the ADMX (see the options below).

PowerShell

PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.

Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.

Enable

# Enable: office16/L_AutomationSecurity
$k = 'HKCU:\software\policies\microsoft\office\common\security'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# Set the Automation Security level
# Possible options:
#   Disable macros by default = 3
#   Use application macro security level = 2
#   Macros enabled (default) = 1
Set-ItemProperty -Path $k -Name 'automationsecurity' -Value 1 -Type DWord

Disable

# Disable: office16/L_AutomationSecurity
# No value is written in the "Disabled" state (nothing defined in the ADMX)

Revert to "Not configured"

# Revert to "Not configured": office16/L_AutomationSecurity
$k = 'HKCU:\software\policies\microsoft\office\common\security'
Remove-ItemProperty -Path $k -Name 'automationsecurity' -ErrorAction SilentlyContinue

Options (1)

LabelControlRegistry valueREG typeConstraints / details
Set the Automation Security levelL_SettheAutomationSecuritylevelDrop-down listenumautomationsecurityREG_DWORD
Default choice (UI): #2
LabelValue
Disable macros by defaultREG_DWORD = 3
Use application macro security levelREG_DWORD = 2
Macros enabled (default)REG_DWORD = 1

Application

Microsoft 365 Apps / Office (Microsoft) — November 2026 templates

Official templates downloaded on November 12, 2026.