Skip to content
Setup FoundrySetup Foundry

Documentation

Automation Security

This per-user registry value controls how Excel, PowerPoint, and Word handle macros when another application starts the Office application programmatically.

since 0.9.8.11

Purpose

Show registry keys (1)
  • HKCU\software\policies\microsoft\office\common\security\automationsecurity

This per-user registry value controls how Excel, PowerPoint, and Word handle macros when another application starts the Office application programmatically. It is a REG_DWORD value whose data corresponds to the Office MsoAutomationSecurity enumeration:

  • 1 (msoAutomationSecurityLow): Macros are enabled in the programmatically started application.
  • 2 (msoAutomationSecurityByUI): The application follows its applicable macro security configuration, such as the Macro Settings in Trust Center.
  • 3 (msoAutomationSecurityForceDisable): Macros in files opened programmatically are disabled without displaying security warnings for those macros.

The setting applies globally to Excel, PowerPoint, and Word rather than being stored separately for each application.

Notes

Security

A value of 1 permits macros to run in programmatically started Office applications. If an automation solution opens a file containing malicious macro code, that code can run with the signed-in user's permissions.

A value of 2 delegates the decision to the application's macro security configuration. The effective level of protection therefore depends on the user and policy settings that apply to that application.

A value of 3 prevents VBA macros from running in the affected programmatically opened files. This reduces the risk that another application can use Office automation for unattended macro execution. In Excel, however, this mode does not disable Excel 4.0 macros; Excel prompts the user when a file containing such macros is opened programmatically.

Possible side effects

A value of 3 can disrupt automation solutions, document templates, and line-of-business applications that depend on macros contained in files opened programmatically.

With a value of 2, the application's macro settings can produce security warnings or other user interaction. Such prompts can interrupt unattended processes.

Notes

This setting covers the specific case in which Excel, PowerPoint, or Word is started through Automation and files are opened programmatically. It is distinct from the general, application-specific policies that configure macro security.

Microsoft documentation

Microsoft Learn: MsoAutomationSecurity enumeration (Office)

Microsoft Learn: Application.AutomationSecurity property (Excel)

Microsoft Download Center: Administrative Template files for Microsoft Office

See also