Microsoft Excel 2016 › Excel Options › Security › Trust Center
Macro Notification Settings
Supported on SUPPORTED_Windows7 (defined in the Windows templates)
What it does
This policy setting controls how the specified applications warn users when Visual Basic for Applications (VBA) macros or Excel 4.0 (XLM) macros are present. Multiple Office apps support VBA macros, but XLM macros are only supported by Excel. If you enable this policy setting, you can choose from four options to determine how the specified applications will warn the user about VBA macros. There is also a check box that determines how Excel will warn the user about XLM macros. For VBA macros, these are your choices: - Disable VBA macros without notification: The application disables VBA macros, whether signed or unsigned, and does not notify users. - Disable VBA macros with notification: The application displays the Trust Bar for VBA macros, whether signed or unsigned. This option enforces the default configuration in Office. - Disable VBA macros except digitally signed macros: The application displays the Trust Bar for digitally signed macros, allowing users to enable them or leave them disabled. Any unsigned macros are disabled, and users are not notified. - Enable VBA macros (not recommended): VBA macros are enabled, whether signed or unsigned. This option can significantly reduce security by allowing dangerous code to run undetected. If you disable or don’t configure this policy setting, "Disable VBA macros with notification" will be the default setting, and “Enable Excel 4.0 macros when VBA macros are enabled” will be checked. When users open files in the specified applications that contain VBA or XLM macros, the applications open the files with the macros disabled and display the Trust Bar with a warning that macros are present and have been disabled. Users can inspect and edit the files if appropriate, but cannot use any disabled functionality until they enable it by clicking "Enable Content" on the Trust Bar. The following section only applies to Excel 4.0 (XLM) macros: If you select the “Enable Excel 4.0 macros when VBA macros are enabled” check box, the setting selected for VBA macros will also apply to XLM macros. If this check box is not selected, all XLM macros are disabled and users are not notified. XLM macros cannot be signed and will be disabled if “Disable VBA macros except digitally signed macros” is chosen. If you have enabled the “Prevent Excel from running XLM macros” policy setting, XLM macros cannot be run in Excel regardless of how you have configured this policy setting. The following section only applies to VBA macros: If you select the “Require macros to be signed by a trusted publisher” check box, users opening files with digitally signed macros but not by a Trusted Publisher will receive a notification that macros are blocked from running. And there are two additional check boxes that we recommend that you select to help improve security. - Block certificates from trusted publishers that are installed in the current user certificate store - Require Extended Key Usage (EKU) for certificates from trusted publishers Note: These two check boxes only apply if you have selected the "Require macros to be signed by a trusted publisher" check box. Note: The three check boxes about trusted publishers only apply to Version 2012 and later of Office and Visio. The “Enable Excel 4.0 macros when VBA macros are enabled” check box only applies to Version 2111 and later of Office. None of the check boxes apply to Office 2016 or Office 2019. If you select the “Block certificates from trusted publishers that are installed in the local machine certificate store” check box, macros won’t run if the certificate from the trusted publisher is installed in the current user certificate store. The certificate must be installed in the local machine certificate store for the macro to run. Only accounts with administrator access to the computer can install a certificate in the local machine certificate store. If you select the “Require Extended Key Usage (EKU) for certificates from trusted publishers” check box, the EKU must include “Code Signing” as one of the uses of the certificate. Important: If "Disable all except digitally signed macros" is selected, users will not be able to open unsigned Access databases. Also, note that Microsoft Office stores certificates for trusted publishers in the Internet Explorer trusted publisher store. Earlier versions of Microsoft Office stored trusted publisher certificate information (specifically, the certificate thumbprint) in a special Office trusted publisher store. Microsoft Office still reads trusted publisher certificate information from the Office trusted publisher store, but it does not write information to this store. Therefore, if you created a list of trusted publishers in a previous version of Microsoft Office and you upgrade to Office, your trusted publisher list will still be recognized. However, any trusted publisher certificates that you add to the list will be stored in the Internet Explorer trusted publisher store.
What it writes
- Hive
- HKEY_CURRENT_USER
- Registry key
software\policies\microsoft\office\16.0\excel\security
Why it needs changes for Intune
- Policy references a Windows supportedOn definition.
- ADMX-INTUNE-WINDOWS-SUPPORTEDON-REFERENCE
Security baselines
Microsoft's Microsoft 365 Apps for Enterprise 2512 sets this to Enabled, in its GPO “MSFT Microsoft 365 Apps v2512 - Require Macro Signing - User”.
- vbawarnings
- Set to “Disable VBA macros except digitally signed macros” (3).
- Enable Excel 4.0 macros when VBA macros are enabled
- Unchecked (0).
- Require macros to be signed by a trusted publisher
- Checked (1).
- Block certificates from trusted publishers that are only installed in the current user certificate store
- Unchecked (0).
- Require Extended Key Usage (EKU) for certificates from trusted publishers
- Unchecked (0).
Read from the registry.pol files in the baselines' GPO backups, downloaded from Microsoft's Security Compliance Toolkit. All baselines
Options
| Option | Type | Registry value | Allowed values |
|---|---|---|---|
| L_empty4Default: Disable VBA macros without notification | Drop-down list | vbawarnings |
|
| Enable Excel 4.0 macros when VBA macros are enabled | Checkbox | xl4macrowarningfollowvba |
On (1) or off (0) |
| Require macros to be signed by a trusted publisher | Checkbox | vbadigsigtrustedpublishers |
On (1) or off (0) |
| Block certificates from trusted publishers that are only installed in the current user certificate store | Checkbox | vbarequirelmtrustedpublisher |
On (1) or off (0) |
| Require Extended Key Usage (EKU) for certificates from trusted publishers | Checkbox | vbarequiredigsigwithcodesigningeku |
On (1) or off (0) |
Configure and deploy
Choose a state and the option values; the output below is generated from the template for exactly that.
Enabled · User · template defaults
Registry file (.reg)
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security]
"vbadigsigtrustedpublishers"=dword:00000001
"vbarequiredigsigwithcodesigningeku"=dword:00000001
"vbarequirelmtrustedpublisher"=dword:00000001
"vbawarnings"=dword:00000004
"xl4macrowarningfollowvba"=dword:00000001
PowerShell
$ErrorActionPreference = 'Stop'
function Set-RegistryValue {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name,
[Parameter(Mandatory = $true)][string] $PropertyType,
[Parameter(Mandatory = $true)][object] $Value
)
if (-not (Test-Path -LiteralPath $Path)) {
New-Item -Path $Path -Force | Out-Null
}
New-ItemProperty -LiteralPath $Path -Name $Name -PropertyType $PropertyType -Value $Value -Force | Out-Null
}
function Remove-RegistryValue {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name
)
if (Test-Path -LiteralPath $Path) {
Remove-ItemProperty -LiteralPath $Path -Name $Name -Force -ErrorAction SilentlyContinue
}
}
function Clear-RegistryKeyValues {
param(
[Parameter(Mandatory = $true)][string] $Path
)
if (-not (Test-Path -LiteralPath $Path)) {
return
}
foreach ($propertyName in (Get-Item -LiteralPath $Path).Property) {
Remove-ItemProperty -LiteralPath $Path -Name $propertyName -Force -ErrorAction SilentlyContinue
}
}
# Policy: Macro Notification Settings
# Name: L_VBAWarningsPolicy
# Scope: User
# State: Enabled
# Source: excel16.admx
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'vbawarnings' -PropertyType 'DWord' -Value 4
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'xl4macrowarningfollowvba' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'vbadigsigtrustedpublishers' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'vbarequirelmtrustedpublisher' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'vbarequiredigsigwithcodesigningeku' -PropertyType 'DWord' -Value 1
- The OMA-URI is an inferred ADMX-backed Policy CSP candidate derived from the source ADMX file name and policy name.
- Some Microsoft policies use built-in Policy CSP pages whose area names don't match the ADMX file name, so verify the candidate against Microsoft Learn before deployment.
- The generated payload is incomplete because one or more ADMX element values were not supplied: L_XL4WarningPolicy, L_VBADigSigTrustedPublishersStr, L_VBAOnlyAllowLMTrustedPublisherStr, L_VBAOnlyAllowDigSigWithCodeSigningEKUStr
ADMX profile candidate (OMA-URI)
./User/Vendor/MSFT/Policy/Config/ADMX_excel16/L_VBAWarningsPolicyIntune remediation scripts
Detection
$ErrorActionPreference = 'Stop'
$reasons = [System.Collections.Generic.List[string]]::new()
function Test-RegistryValueExists {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name
)
if (-not (Test-Path -LiteralPath $Path)) {
return $false
}
return $null -ne (Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction SilentlyContinue)
}
function Test-RegistryValueEquals {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name,
[Parameter(Mandatory = $true)][string] $Kind,
[Parameter(Mandatory = $true)][object] $Expected
)
if (-not (Test-Path -LiteralPath $Path)) {
return $false
}
$valueObject = Get-ItemProperty -LiteralPath $Path -Name $Name -ErrorAction SilentlyContinue
if ($null -eq $valueObject) {
return $false
}
$actual = $valueObject.$Name
switch ($Kind) {
'String' { return [string]$actual -ceq [string]$Expected }
'ExpandString' { return [string]$actual -ceq [string]$Expected }
'DWord' { return [uint32]$actual -eq [uint32]$Expected }
'QWord' { return [uint64]$actual -eq [uint64]$Expected }
'MultiString' {
$actualArray = @($actual)
$expectedArray = @($Expected)
if ($actualArray.Count -ne $expectedArray.Count) { return $false }
for ($index = 0; $index -lt $actualArray.Count; $index++) {
if ([string]$actualArray[$index] -cne [string]$expectedArray[$index]) { return $false }
}
return $true
}
'Binary' {
$actualArray = [byte[]]$actual
$expectedArray = [byte[]]$Expected
if ($actualArray.Length -ne $expectedArray.Length) { return $false }
for ($index = 0; $index -lt $actualArray.Length; $index++) {
if ($actualArray[$index] -ne $expectedArray[$index]) { return $false }
}
return $true
}
default { return [string]$actual -ceq [string]$Expected }
}
}
# Policy: Macro Notification Settings
# Name: L_VBAWarningsPolicy
# Scope: User
# State: Enabled
# Source: excel16.admx
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'vbawarnings' -Kind 'DWord' -Expected 4
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security\vbawarnings') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'xl4macrowarningfollowvba' -Kind 'DWord' -Expected 1
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security\xl4macrowarningfollowvba') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'vbadigsigtrustedpublishers' -Kind 'DWord' -Expected 1
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security\vbadigsigtrustedpublishers') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'vbarequirelmtrustedpublisher' -Kind 'DWord' -Expected 1
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security\vbarequirelmtrustedpublisher') | Out-Null
}
$isMatch = Test-RegistryValueEquals -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'vbarequiredigsigwithcodesigningeku' -Kind 'DWord' -Expected 1
if (-not $isMatch) {
$reasons.Add('Value mismatch: HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security\vbarequiredigsigwithcodesigningeku') | Out-Null
}
if ($reasons.Count -eq 0) {
Write-Output 'Compliant'
exit 0
}
$reasons | ForEach-Object { Write-Output $_ }
exit 1
Remediation
$ErrorActionPreference = 'Stop'
function Set-RegistryValue {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name,
[Parameter(Mandatory = $true)][string] $PropertyType,
[Parameter(Mandatory = $true)][object] $Value
)
if (-not (Test-Path -LiteralPath $Path)) {
New-Item -Path $Path -Force | Out-Null
}
New-ItemProperty -LiteralPath $Path -Name $Name -PropertyType $PropertyType -Value $Value -Force | Out-Null
}
function Remove-RegistryValue {
param(
[Parameter(Mandatory = $true)][string] $Path,
[Parameter(Mandatory = $true)][string] $Name
)
if (Test-Path -LiteralPath $Path) {
Remove-ItemProperty -LiteralPath $Path -Name $Name -Force -ErrorAction SilentlyContinue
}
}
function Clear-RegistryKeyValues {
param(
[Parameter(Mandatory = $true)][string] $Path
)
if (-not (Test-Path -LiteralPath $Path)) {
return
}
foreach ($propertyName in (Get-Item -LiteralPath $Path).Property) {
Remove-ItemProperty -LiteralPath $Path -Name $propertyName -Force -ErrorAction SilentlyContinue
}
}
# Policy: Macro Notification Settings
# Name: L_VBAWarningsPolicy
# Scope: User
# State: Enabled
# Source: excel16.admx
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'vbawarnings' -PropertyType 'DWord' -Value 4
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'xl4macrowarningfollowvba' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'vbadigsigtrustedpublishers' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'vbarequirelmtrustedpublisher' -PropertyType 'DWord' -Value 1
Set-RegistryValue -Path 'Registry::HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security' -Name 'vbarequiredigsigwithcodesigningeku' -PropertyType 'DWord' -Value 1
History 1 retained release
- 5568.100010 Aug 2026
- Already present in the first release ChangeIntel keeps.
Template
- Internal name
L_VBAWarningsPolicy- Namespace
excel16.Office.Microsoft.Policies.Windows- Template file
excel16.admx- Release
- Microsoft 365 Apps 5568.1000 · file set
8be05d876aae137d…
Definition, editor controls and support
Definition
<policy Area="Security Baseline" AreaCategory="Macros" class="User" displayName="$(string.L_VBAWarningsPolicy)" explainText="$(string.L_VBAWarningsExplain)" key="software\policies\microsoft\office\16.0\excel\security" name="L_VBAWarningsPolicy" presentation="$(presentation.L_VBAWarningsPolicy)" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="excel16.Office.Microsoft.Policies.Windows:L_TrustCenter" />
<supportedOn ref="Microsoft.Policies.Windows:SUPPORTED_Windows7" />
<elements>
<enum id="L_empty4" valueName="vbawarnings">
<item displayName="$(string.L_DisableAllWithoutNotification)">
<value>
<decimal value="4" />
</value>
</item>
<item displayName="$(string.L_DisableAllWithNotification)">
<value>
<decimal value="2" />
</value>
</item>
<item displayName="$(string.L_DisableAllExceptDigitallySignedMacros)">
<value>
<decimal value="3" />
</value>
</item>
<item displayName="$(string.L_EnableAllMacros)">
<value>
<decimal value="1" />
</value>
</item>
</enum>
<boolean id="L_XL4WarningPolicy" key="software\policies\microsoft\office\16.0\excel\security" valueName="xl4macrowarningfollowvba">
<trueValue>
<decimal value="1" />
</trueValue>
<falseValue>
<decimal value="0" />
</falseValue>
</boolean>
<boolean id="L_VBADigSigTrustedPublishersStr" key="software\policies\microsoft\office\16.0\excel\security" valueName="vbadigsigtrustedpublishers">
<trueValue>
<decimal value="1" />
</trueValue>
<falseValue>
<decimal value="0" />
</falseValue>
</boolean>
<boolean id="L_VBAOnlyAllowLMTrustedPublisherStr" key="software\policies\microsoft\office\16.0\excel\security" valueName="vbarequirelmtrustedpublisher">
<trueValue>
<decimal value="1" />
</trueValue>
<falseValue>
<decimal value="0" />
</falseValue>
</boolean>
<boolean id="L_VBAOnlyAllowDigSigWithCodeSigningEKUStr" key="software\policies\microsoft\office\16.0\excel\security" valueName="vbarequiredigsigwithcodesigningeku">
<trueValue>
<decimal value="1" />
</trueValue>
<falseValue>
<decimal value="0" />
</falseValue>
</boolean>
</elements>
</policy>Editor controls
<presentation id="L_VBAWarningsPolicy" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<dropdownList defaultItem="0" noSort="true" refId="L_empty4">
</dropdownList>
<checkBox refId="L_XL4WarningPolicy">Enable Excel 4.0 macros when VBA macros are enabled</checkBox>
<checkBox refId="L_VBADigSigTrustedPublishersStr">Require macros to be signed by a trusted publisher</checkBox>
<checkBox refId="L_VBAOnlyAllowLMTrustedPublisherStr">Block certificates from trusted publishers that are only installed in the current user certificate store</checkBox>
<checkBox refId="L_VBAOnlyAllowDigSigWithCodeSigningEKUStr">Require Extended Key Usage (EKU) for certificates from trusted publishers</checkBox>
</presentation>Supported platforms and category
excel16.Office.Microsoft.Policies.Windows:category:L_ExcelOptions
<category displayName="$(string.L_ExcelOptions)" name="L_ExcelOptions" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="excel16.Office.Microsoft.Policies.Windows:L_MicrosoftOfficeExcel" />
</category>
excel16.Office.Microsoft.Policies.Windows:category:L_MicrosoftOfficeExcel
<category displayName="$(string.L_MicrosoftOfficeExcel)" name="L_MicrosoftOfficeExcel" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions" />
excel16.Office.Microsoft.Policies.Windows:category:L_Security
<category displayName="$(string.L_Security)" name="L_Security" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="excel16.Office.Microsoft.Policies.Windows:L_ExcelOptions" />
</category>
excel16.Office.Microsoft.Policies.Windows:category:L_TrustCenter
<category displayName="$(string.L_TrustCenter)" name="L_TrustCenter" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="excel16.Office.Microsoft.Policies.Windows:L_Security" />
</category>
excel16.Office.Microsoft.Policies.Windows:unresolved:Microsoft.Policies.Windows:SUPPORTED_Windows7
<unresolved reference="Microsoft.Policies.Windows:SUPPORTED_Windows7" />
excel16.Office.Microsoft.Policies.Windows:category:L_ExcelOptions
<category displayName="$(string.L_ExcelOptions)" name="L_ExcelOptions" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="excel16.Office.Microsoft.Policies.Windows:L_MicrosoftOfficeExcel" />
</category>
<strings><string id="excel16.Office.Microsoft.Policies.Windows:L_ExcelOptions">Excel Options</string></strings>
excel16.Office.Microsoft.Policies.Windows:category:L_MicrosoftOfficeExcel
<category displayName="$(string.L_MicrosoftOfficeExcel)" name="L_MicrosoftOfficeExcel" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions" />
<strings><string id="excel16.Office.Microsoft.Policies.Windows:L_MicrosoftOfficeExcel">Microsoft Excel 2016</string></strings>
excel16.Office.Microsoft.Policies.Windows:category:L_Security
<category displayName="$(string.L_Security)" name="L_Security" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="excel16.Office.Microsoft.Policies.Windows:L_ExcelOptions" />
</category>
<strings><string id="excel16.Office.Microsoft.Policies.Windows:L_Security">Security</string></strings>
excel16.Office.Microsoft.Policies.Windows:category:L_TrustCenter
<category displayName="$(string.L_TrustCenter)" name="L_TrustCenter" xmlns="http://schemas.microsoft.com/GroupPolicy/2006/07/PolicyDefinitions">
<parentCategory ref="excel16.Office.Microsoft.Policies.Windows:L_Security" />
</category>
<strings><string id="excel16.Office.Microsoft.Policies.Windows:L_TrustCenter">Trust Center</string></strings>