Disable predefined commands
Explanation
This policy setting allows you to disable specific command bar buttons and menu items in the specified applications.
If you enable this policy setting you can disable specific command bar buttons and menu items in the user interface for the selected application. The predefined list of command bar buttons and menu items you can disable becomes available to you when you enable this policy setting.
If you disable or do not configure this policy setting, the predefined list of command bar buttons and menu items are enabled for the application.
Registry
HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\disabledcmdbaritemscheckboxes- Value name
- not defined in the ADMX
| State | Value written | |||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Enabled | not defined in the ADMX (see the options below) | |||||||||||||||
| Disabled |
|
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: excel16/L_Disablecommandbarbuttonsandmenuitems
$k = 'HKCU:\software\policies\microsoft\office\16.0\excel\disabledcmdbaritemscheckboxes'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# File tab | Options | Customize Ribbon | All Commands | Web Page Preview
# unchecked: 0
Set-ItemProperty -Path $k -Name 'filewebpagepreview' -Value '3655' -Type String
# File tab | Share | Email
# unchecked: 0
Set-ItemProperty -Path $k -Name 'sendtomailrecipient' -Value '2188' -Type String
# Insert tab | Links | Hyperlink
# unchecked: 0
Set-ItemProperty -Path $k -Name 'inserthyperlink' -Value '1576' -Type String
# Review tab | Changes | Protect Sheet
# unchecked: 0
Set-ItemProperty -Path $k -Name 'toolsprotectsheet' -Value '893' -Type String
# Review tab | Changes | Protect Workbook
# unchecked: 0
Set-ItemProperty -Path $k -Name 'flyoutanchorprotectworkbookmenu' -Value '16132' -Type String
# Review tab | Changes | Protect and Share Workbook
# unchecked: 0
Set-ItemProperty -Path $k -Name 'toolsprotectshare' -Value '3059' -Type String
# View tab | Macros | Macros
# unchecked: 0
Set-ItemProperty -Path $k -Name 'flyoutanchormacros' -Value '16106' -Type String
# Developer tab | Code | Macros
# unchecked: 0
Set-ItemProperty -Path $k -Name 'toolsmacromacros' -Value '186' -Type String
# Developer tab | Code | Record Macro
# unchecked: 0
Set-ItemProperty -Path $k -Name 'toolsmacrorecord' -Value '184' -Type String
# Developer tab | Code | Macro Security
# unchecked: 0
Set-ItemProperty -Path $k -Name 'toolsmacrosecurity' -Value '3627' -Type String
# Developer tab | Code | Visual Basic
# unchecked: 0
Set-ItemProperty -Path $k -Name 'toolsmacrovbe' -Value '1695' -Type String
# File tab | Options | Customize Ribbon | All Commands | Document Location
# unchecked: 0
Set-ItemProperty -Path $k -Name 'webaddress' -Value '1740' -Type StringDisable
# Disable: excel16/L_Disablecommandbarbuttonsandmenuitems
$k = 'HKCU:\software\policies\microsoft\office\16.0\excel\disabledcmdbaritemscheckboxes'
Remove-ItemProperty -Path $k -Name 'filepublishaswebpage' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'weboptions' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'generaloptions' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'fileopensearchtheweb' -ErrorAction SilentlyContinueRevert to "Not configured"
# Revert to "Not configured": excel16/L_Disablecommandbarbuttonsandmenuitems
$k = 'HKCU:\software\policies\microsoft\office\16.0\excel\disabledcmdbaritemscheckboxes'
Remove-ItemProperty -Path $k -Name 'filepublishaswebpage' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'weboptions' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'generaloptions' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'fileopensearchtheweb' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'filewebpagepreview' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'sendtomailrecipient' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'inserthyperlink' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'toolsprotectsheet' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'flyoutanchorprotectworkbookmenu' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'toolsprotectshare' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'flyoutanchormacros' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'toolsmacromacros' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'toolsmacrorecord' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'toolsmacrosecurity' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'toolsmacrovbe' -ErrorAction SilentlyContinue
Remove-ItemProperty -Path $k -Name 'webaddress' -ErrorAction SilentlyContinueOptions (12)
| Label | Control | Registry value | REG type | Constraints / details |
|---|---|---|---|---|
| File tab | Options | Customize Ribbon | All Commands | Web Page PreviewL_OfficeButtonxcelOptionsCustomizationCombinedPreviewWebPagePreview | Check boxboolean | filewebpagepreview | REG_SZ | Checked: REG_SZ = 3655Unchecked: REG_SZ = 0 |
| File tab | Share | EmailL_OfficeButtonExcelOptionsCustomizationMailRecipient | Check boxboolean | sendtomailrecipient | REG_SZ | Checked: REG_SZ = 2188Unchecked: REG_SZ = 0 |
| Insert tab | Links | HyperlinkL_InsertLinksHyperlink | Check boxboolean | inserthyperlink | REG_SZ | Checked: REG_SZ = 1576Unchecked: REG_SZ = 0 |
| Review tab | Changes | Protect SheetL_ReviewChangesProtectSheet | Check boxboolean | toolsprotectsheet | REG_SZ | Checked: REG_SZ = 893Unchecked: REG_SZ = 0 |
| Review tab | Changes | Protect WorkbookL_ReviewChangesProtectWorkbook | Check boxboolean | flyoutanchorprotectworkbookmenu | REG_SZ | Checked: REG_SZ = 16132Unchecked: REG_SZ = 0 |
| Review tab | Changes | Protect and Share WorkbookL_ReviewChangesProtectSharing | Check boxboolean | toolsprotectshare | REG_SZ | Checked: REG_SZ = 3059Unchecked: REG_SZ = 0 |
| View tab | Macros | MacrosL_ViewMacrosMacros | Check boxboolean | flyoutanchormacros | REG_SZ | Checked: REG_SZ = 16106Unchecked: REG_SZ = 0 |
| Developer tab | Code | MacrosL_DeveloperCodeMacros | Check boxboolean | toolsmacromacros | REG_SZ | Checked: REG_SZ = 186Unchecked: REG_SZ = 0 |
| Developer tab | Code | Record MacroL_DeveloperCodeRecordMacro | Check boxboolean | toolsmacrorecord | REG_SZ | Checked: REG_SZ = 184Unchecked: REG_SZ = 0 |
| Developer tab | Code | Macro SecurityL_DeveloperCodemacroSecurity | Check boxboolean | toolsmacrosecurity | REG_SZ | Checked: REG_SZ = 3627Unchecked: REG_SZ = 0 |
| Developer tab | Code | Visual BasicL_DeveloperCodeVisualbasic | Check boxboolean | toolsmacrovbe | REG_SZ | Checked: REG_SZ = 1695Unchecked: REG_SZ = 0 |
| File tab | Options | Customize Ribbon | All Commands | Document LocationL_OfficeButtonExcelOptionsCustomizeDocumentLocation | Check boxboolean | webaddress | REG_SZ | Checked: REG_SZ = 1740Unchecked: REG_SZ = 0 |
Application
Microsoft 365 Apps / Office (Microsoft) — November 2026 templates
Official templates downloaded on November 12, 2026.