Open in the explorer

Microsoft Office query files

Type
User
GPO path
User Configuration › Policies › Administrative Templates › Microsoft Excel 2016 › Excel Options › Security › Trust Center › File Block Settings
Supported on
At least Windows Server 2008 R2 or Windows 7
ADMX file
excel16.admx
Internal name
excel16/L_MicrosoftOfficeQueryFiles

Explanation

This policy setting allows you to determine whether users can open, view, edit, or save Excel files with the format specified by the title of this policy setting.

If you enable this policy setting, you can specify whether users can open, view, edit, or save files.

The options that can be selected are below. Note: Not all options may be available for this policy setting.

- Do not block: The file type will not be blocked.

- Save blocked: Saving of the file type will be blocked.

- Open/Save blocked, use open policy: Both opening and saving of the file type will be blocked. The file will open based on the policy setting configured in the "default file block behavior" key.

- Block: Both opening and saving of the file type will be blocked, and the file will not open.

- Open in Protected View: Both opening and saving of the file type will be blocked, and the option to edit the file type will not be enabled.

- Allow editing and open in Protected View: Both opening and saving of the file type will be blocked, and the option to edit will be enabled.

If you disable or do not configure this policy setting, the file type will not be blocked.

Registry

HKEY_CURRENT_USER\software\policies\microsoft\office\16.0\excel\security\fileblock
Value name
not defined in the ADMX

Enable / disable values: not defined in the ADMX (see the options below).

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_MicrosoftOfficeQueryFiles
$k = 'HKCU:\software\policies\microsoft\office\16.0\excel\security\fileblock'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
# File block setting
# Possible options:
#   Do not block = 0
#   Save blocked = 1
#   Open/Save blocked, use open policy = 2
#   Block = 3
#   Open in Protected View = 4
#   Allow editing and open in Protected View = 5
Set-ItemProperty -Path $k -Name 'officequeries' -Value 0 -Type DWord

Disable

# Disable: excel16/L_MicrosoftOfficeQueryFiles
# No value is written in the "Disabled" state (nothing defined in the ADMX)

Revert to "Not configured"

# Revert to "Not configured": excel16/L_MicrosoftOfficeQueryFiles
$k = 'HKCU:\software\policies\microsoft\office\16.0\excel\security\fileblock'
Remove-ItemProperty -Path $k -Name 'officequeries' -ErrorAction SilentlyContinue

Options (1)

LabelControlRegistry valueREG typeConstraints / details
File block setting:L_MicrosoftOfficeQueryFilesDropIDDrop-down listenumofficequeriesREG_DWORD
Default choice (UI): #0
LabelValue
Do not blockREG_DWORD = 0
Save blockedREG_DWORD = 1
Open/Save blocked, use open policyREG_DWORD = 2
BlockREG_DWORD = 3
Open in Protected ViewREG_DWORD = 4
Allow editing and open in Protected ViewREG_DWORD = 5

Application

Microsoft 365 Apps / Office (Microsoft) — November 2026 templates

Official templates downloaded on November 12, 2026.