巨集通知設定 的登錄值 vbawarnings 等 4 個使用者HKCU\software\policies\microsoft\office\16.0\excel\security

原則 ID
L_VBAWarningsPolicy
適用範圍
使用者設定
支援的作業系統
至少需要 Windows Server 2008 R2 或 Windows 7
來源
Microsoft 365 Apps / Office Administrative Templates (版本 5568.1000)
類別
Microsoft Excel 2016 › Excel 選項 › 安全性 › 信任中心

登錄

vbawarnings

REG_DWORD使用者
啟用時的值
取決於選項值
元素
-
選項
項目儲存的值
停用 VBA 巨集 (不事先通知)4
停用 VBA 巨集 (事先通知)2
除了經數位簽章的巨集外,停用 VBA 巨集3
啟用 VBA 巨集 (不建議使用)1
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security]

; 選項 (只使用其中一個)
; 停用 VBA 巨集 (不事先通知)
"vbawarnings"=dword:00000004
; 停用 VBA 巨集 (事先通知)
"vbawarnings"=dword:00000002
; 除了經數位簽章的巨集外,停用 VBA 巨集
"vbawarnings"=dword:00000003
; 啟用 VBA 巨集 (不建議使用)
"vbawarnings"=dword:00000001
CMD
:: 選項 (只使用其中一個)

:: 停用 VBA 巨集 (不事先通知)
reg add "HKCU\software\policies\microsoft\office\16.0\excel\security" /v "vbawarnings" /t REG_DWORD /d 4 /f
:: 停用 VBA 巨集 (事先通知)
reg add "HKCU\software\policies\microsoft\office\16.0\excel\security" /v "vbawarnings" /t REG_DWORD /d 2 /f
:: 除了經數位簽章的巨集外,停用 VBA 巨集
reg add "HKCU\software\policies\microsoft\office\16.0\excel\security" /v "vbawarnings" /t REG_DWORD /d 3 /f
:: 啟用 VBA 巨集 (不建議使用)
reg add "HKCU\software\policies\microsoft\office\16.0\excel\security" /v "vbawarnings" /t REG_DWORD /d 1 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Force | Out-Null

# 選項 (只使用其中一個)
# 停用 VBA 巨集 (不事先通知)
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Name 'vbawarnings' -PropertyType DWord -Value 4 -Force | Out-Null
# 停用 VBA 巨集 (事先通知)
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Name 'vbawarnings' -PropertyType DWord -Value 2 -Force | Out-Null
# 除了經數位簽章的巨集外,停用 VBA 巨集
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Name 'vbawarnings' -PropertyType DWord -Value 3 -Force | Out-Null
# 啟用 VBA 巨集 (不建議使用)
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Name 'vbawarnings' -PropertyType DWord -Value 1 -Force | Out-Null

xl4macrowarningfollowvba

REG_DWORD使用者
已核取
1
未核取
0
元素
在 VBA 巨集啟用時啟用 Excel 4.0 巨集
值類型
REG_DWORD
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security]

; 選項 (只使用其中一個)
; 已核取
"xl4macrowarningfollowvba"=dword:00000001
; 未核取
"xl4macrowarningfollowvba"=dword:00000000
CMD
:: 選項 (只使用其中一個)

:: 已核取
reg add "HKCU\software\policies\microsoft\office\16.0\excel\security" /v "xl4macrowarningfollowvba" /t REG_DWORD /d 1 /f
:: 未核取
reg add "HKCU\software\policies\microsoft\office\16.0\excel\security" /v "xl4macrowarningfollowvba" /t REG_DWORD /d 0 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Force | Out-Null

# 選項 (只使用其中一個)
# 已核取
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Name 'xl4macrowarningfollowvba' -PropertyType DWord -Value 1 -Force | Out-Null
# 未核取
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Name 'xl4macrowarningfollowvba' -PropertyType DWord -Value 0 -Force | Out-Null

vbadigsigtrustedpublishers

REG_DWORD使用者
已核取
1
未核取
0
元素
要求巨集必須由受信任的發行者簽署
值類型
REG_DWORD
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security]

; 選項 (只使用其中一個)
; 已核取
"vbadigsigtrustedpublishers"=dword:00000001
; 未核取
"vbadigsigtrustedpublishers"=dword:00000000
CMD
:: 選項 (只使用其中一個)

:: 已核取
reg add "HKCU\software\policies\microsoft\office\16.0\excel\security" /v "vbadigsigtrustedpublishers" /t REG_DWORD /d 1 /f
:: 未核取
reg add "HKCU\software\policies\microsoft\office\16.0\excel\security" /v "vbadigsigtrustedpublishers" /t REG_DWORD /d 0 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Force | Out-Null

# 選項 (只使用其中一個)
# 已核取
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Name 'vbadigsigtrustedpublishers' -PropertyType DWord -Value 1 -Force | Out-Null
# 未核取
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Name 'vbadigsigtrustedpublishers' -PropertyType DWord -Value 0 -Force | Out-Null

vbarequirelmtrustedpublisher

REG_DWORD使用者
已核取
1
未核取
0
元素
封鎖來自僅安裝於目前使用者憑證存放區中的受信任發行者憑證
值類型
REG_DWORD
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security]

; 選項 (只使用其中一個)
; 已核取
"vbarequirelmtrustedpublisher"=dword:00000001
; 未核取
"vbarequirelmtrustedpublisher"=dword:00000000
CMD
:: 選項 (只使用其中一個)

:: 已核取
reg add "HKCU\software\policies\microsoft\office\16.0\excel\security" /v "vbarequirelmtrustedpublisher" /t REG_DWORD /d 1 /f
:: 未核取
reg add "HKCU\software\policies\microsoft\office\16.0\excel\security" /v "vbarequirelmtrustedpublisher" /t REG_DWORD /d 0 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Force | Out-Null

# 選項 (只使用其中一個)
# 已核取
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Name 'vbarequirelmtrustedpublisher' -PropertyType DWord -Value 1 -Force | Out-Null
# 未核取
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Name 'vbarequirelmtrustedpublisher' -PropertyType DWord -Value 0 -Force | Out-Null

vbarequiredigsigwithcodesigningeku

REG_DWORD使用者
已核取
1
未核取
0
元素
需要擴充金鑰使用方法 (EKU) 取得之來自受信任發行者的憑證
值類型
REG_DWORD
以 .reg · CMD · PowerShell 套用
.reg
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security]

; 選項 (只使用其中一個)
; 已核取
"vbarequiredigsigwithcodesigningeku"=dword:00000001
; 未核取
"vbarequiredigsigwithcodesigningeku"=dword:00000000
CMD
:: 選項 (只使用其中一個)

:: 已核取
reg add "HKCU\software\policies\microsoft\office\16.0\excel\security" /v "vbarequiredigsigwithcodesigningeku" /t REG_DWORD /d 1 /f
:: 未核取
reg add "HKCU\software\policies\microsoft\office\16.0\excel\security" /v "vbarequiredigsigwithcodesigningeku" /t REG_DWORD /d 0 /f
PowerShell
# 共通: 建立機碼
New-Item -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Force | Out-Null

# 選項 (只使用其中一個)
# 已核取
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Name 'vbarequiredigsigwithcodesigningeku' -PropertyType DWord -Value 1 -Force | Out-Null
# 未核取
New-ItemProperty -Path 'HKCU:\software\policies\microsoft\office\16.0\excel\security' -Name 'vbarequiredigsigwithcodesigningeku' -PropertyType DWord -Value 0 -Force | Out-Null