Ouvrir dans l'explorateur

Macro Notification Settings

Cette stratégie n'a pas de traduction française dans les modèles de l'éditeur ; le texte original est en anglais.

Type
Utilisateur
Chemin GPO
Configuration utilisateur › Stratégies › Modèles d'administration › Microsoft Excel 2016 › Options Excel › Sécurité › Centre de gestion de la confidentialité EN : User Configuration › Policies › Administrative Templates › Microsoft Excel 2016 › Excel Options › Security › Trust Center
Pris en charge sur
At least Windows Server 2008 R2 or Windows 7
Fichier ADMX
excel16.admx
Nom interne
excel16/L_VBAWarningsPolicy

Explication

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.

Cas d'usage

Définit la notification des macros VBA dans Excel. Si vous n’utilisez pas le blocage des macros venant d’Internet, Microsoft recommande la valeur « Désactiver les macros VBA sauf celles signées numériquement » (dans Excel, le mot « toutes » est remplacé par « VBA »), avec l’obligation que les macros soient signées par un éditeur approuvé, dont le certificat est installé sur les postes.

Vérifiez le circuit de signature de vos classeurs métier (finance, contrôle de gestion) avant de durcir. Pour les compléments Excel (.xla, .xlam) marqués Internet, la signature ne suffit pas : il faut retirer la marque, ou les placer dans un emplacement approuvé.

Source Microsoft : Macros from the internet are blocked by default in Office

Registre

HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security
Nom de la valeur
non défini dans l'ADMX

Valeurs d'activation / désactivation : non défini dans l'ADMX (voir les options ci-dessous).

PowerShell

Commandes PowerShell qui écrivent dans le registre ce que la stratégie écrirait. Les valeurs entre chevrons (<…>) sont à remplacer.

Écrire directement dans le registre contourne la stratégie de groupe : si une GPO gère cette valeur, elle sera réécrite au prochain gpupdate ; sinon la valeur reste en place (effet « tatouage »). Préférez une GPO ou, en local, LGPO.exe. Exécutez PowerShell en administrateur pour HKLM. Certaines stratégies demandent un redémarrage ou gpupdate /force.

Activer

# Activer : excel16/L_VBAWarningsPolicy
$k = 'HKCU:\software\policies\microsoft\office\16.0\excel\security'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
#
# Options possibles :
#   Disable VBA macros without notification = 4
#   Disable VBA macros with notification = 2
#   Disable VBA macros except digitally signed macros = 3
#   Enable VBA macros (not recommended) = 1
Set-ItemProperty -Path $k -Name 'vbawarnings' -Value 4 -Type DWord
# Enable Excel 4.0 macros when VBA macros are enabled
# décoché : 0
Set-ItemProperty -Path $k -Name 'xl4macrowarningfollowvba' -Value 1 -Type DWord
# Require macros to be signed by a trusted publisher
# décoché : 0
Set-ItemProperty -Path $k -Name 'vbadigsigtrustedpublishers' -Value 1 -Type DWord
# Block certificates from trusted publishers that are only installed in the current user certificate store
# décoché : 0
Set-ItemProperty -Path $k -Name 'vbarequirelmtrustedpublisher' -Value 1 -Type DWord
# Require Extended Key Usage (EKU) for certificates from trusted publishers
# décoché : 0
Set-ItemProperty -Path $k -Name 'vbarequiredigsigwithcodesigningeku' -Value 1 -Type DWord

Désactiver

# Désactiver : excel16/L_VBAWarningsPolicy
# Aucune valeur n'est écrite à l'état « Désactivé » (rien de défini dans l'ADMX)

Revenir à « Non configuré »

# Revenir à « Non configuré » : excel16/L_VBAWarningsPolicy
$k = 'HKCU:\software\policies\microsoft\office\16.0\excel\security'
Remove-ItemProperty -Path $k -Name 'vbawarnings' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'xl4macrowarningfollowvba' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'vbadigsigtrustedpublishers' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'vbarequirelmtrustedpublisher' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'vbarequiredigsigwithcodesigningeku' -ErrorAction SilentlyContinue

Options (5)

LibelléContrôleValeur de registreType REGContraintes / détails
L_empty4Liste déroulanteenumvbawarningsREG_DWORD
Choix par défaut (interface) : n° 0
LibelléValeur
Disable VBA macros without notificationREG_DWORD = 4
Disable VBA macros with notificationREG_DWORD = 2
Disable VBA macros except digitally signed macrosREG_DWORD = 3
Enable VBA macros (not recommended)REG_DWORD = 1
Enable Excel 4.0 macros when VBA macros are enabledL_XL4WarningPolicyCase à cocherbooleanxl4macrowarningfollowvbaREG_DWORD
Coché : REG_DWORD = 1
Décoché : REG_DWORD = 0
Require macros to be signed by a trusted publisherL_VBADigSigTrustedPublishersStrCase à cocherbooleanvbadigsigtrustedpublishersREG_DWORD
Coché : REG_DWORD = 1
Décoché : REG_DWORD = 0
Block certificates from trusted publishers that are only installed in the current user certificate storeL_VBAOnlyAllowLMTrustedPublisherStrCase à cocherbooleanvbarequirelmtrustedpublisherREG_DWORD
Coché : REG_DWORD = 1
Décoché : REG_DWORD = 0
Require Extended Key Usage (EKU) for certificates from trusted publishersL_VBAOnlyAllowDigSigWithCodeSigningEKUStrCase à cocherbooleanvbarequiredigsigwithcodesigningekuREG_DWORD
Coché : REG_DWORD = 1
Décoché : REG_DWORD = 0

Application

Microsoft 365 Apps / Office (Microsoft) — modèles de novembre 2026

Modèles officiels téléchargés le 12 novembre 2026.