en-US office user

Macro Runtime Scan Scope

Verified with Microsoft 365/Office 5568.1000 — updated on September 4, 2026

Microsoft 365/Office 5568.1000

Supported on: At least Windows Server 2016, Windows 10

Path in the GPO console

User Configuration\Administrative Templates\Microsoft Office 2016\Security Settings

Description

This policy setting specifies the behavior for both the VBA and Excel 4.0 (XLM) runtime scan features. Multiple Office apps support VBA macros, but XLM macros are only supported by Excel. Macros can only be scanned if the anti-virus software registers as an Antimalware Scan Interface (AMSI) provider on the device. If you enable this policy setting, you can choose from the following options to determine the macro runtime scanning behavior: - Disable for all files (not recommended): If you choose this option, no runtime scanning of enabled macros will be performed. - Enable for low trust files: If you choose this option, runtime scanning will be enabled for all files for which macros are enabled, except for the following files: - Files opened while macro security settings are set to “Enable All Macros” - Files opened from a Trusted Location - Files that are Trusted Documents - Files that contain VBA that is digitally signed by a Trusted Publisher - Enable for all files: If you choose this option, then low trust files are not excluded from runtime scanning. - Enable for files, excluding documents marked as trusted by an admin: If you choose this option, runtime scanning will be enabled for all files for which macros are enabled, except for the following files: - Files opened from a Trusted Location - Files that contain VBA that is digitally signed by a Trusted Publisher The VBA and XLM runtimes report to an antivirus system certain high-risk code behaviors the macro is about to execute. This allows the antivirus system to indicate whether or not the macro behavior is malicious. If the behavior is determined to be malicious, the Office application closes the session and the antivirus system can quarantine the file. If the behavior is non-malicious, the macro execution proceeds. Note: When macro runtime scanning is enabled, the runtime performance of affected VBA projects and XLM sheets may be reduced. If you disable this policy setting, no runtime scanning of enabled macros will be performed. If you don’t configure this policy setting, “Enable for low trust files” will be the default setting. Note: This policy setting only applies to subscription versions of Office, such as Microsoft 365 Apps for enterprise.

Registry

HKCU software\policies\microsoft\office\16.0\common\security

More options available

Options

macroruntimescanscope enum
  • Disable for all documents -> 0 (default)
  • Enable for low trust documents -> 1
  • Enable for all documents -> 2
  • Scan excluding documents marked as trusted by an admin -> 3

Export Builder

BETA

Configure the state, scope and options, then generate .reg, PowerShell, Intune and SCCM outputs — or add the setting to a multi-setting collection.

These exports write the registry — this is not a managed GPO.

.reg file

Windows Registry Editor Version 5.00

; Exported from gporais.com
; Policy: Macro Runtime Scan Scope
; State: Enabled
; Supported on: At least Windows Server 2016, Windows 10

[HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\common\security]
"macroruntimescanscope"=dword:00000000
More formats (PowerShell, Intune, SCCM)

PowerShell

# Exported from gporais.com
# Policy: Macro Runtime Scan Scope
# State: Enabled
# Supported on: At least Windows Server 2016, Windows 10
# Warning: In SYSTEM context (the Intune default), HKCU targets the SYSTEM profile. Run this script using the logged-on credentials.

$path = 'HKCU:\software\policies\microsoft\office\16.0\common\security'
New-Item -Path $path -Force | Out-Null
Set-ItemProperty -Path $path -Name 'macroruntimescanscope' -Value 0 -Type DWord

Building a multi-setting collection? Add this setting and generate combined .reg / PowerShell / GPO scripts.

Open the Builder

Embed this policy on your site

What to embed
Theme

Adds one script line: the theme follows your site’s appearance and the height fits the content. If your site blocks scripts, the embed follows the visitor’s system theme.

Preview