Office Admin Explorer

Force file extension to match file type

Registry value
extensionhardening
Group PolicyForce file extension to match file type
German versionÜbereinstimmung der Dateierweiterung mit dem Dateityp erzwingen
Intune settings catalogForce file extension to match file type (User)
ScopeUser · HKCU
ADMXexcel16.admx · L_Forcefileextenstionstomatch
Open in the interactive explorer+ Add to my collection

Group Policy path

User Configuration\Policies\Administrative Templates\Microsoft Excel 2016\Excel Options\Security
Benutzerkonfiguration\Richtlinien\Administrative Vorlagen\Microsoft Excel 2016\Excel-Optionen\Sicherheit

Registry

ValueData
HKCU\Software\policies\microsoft\office\16.0\excel\security
extensionhardening0 = Allow different · 1 = Allow different, but warn · 2 = Always match file type

Not configured = the value does not exist – the application default applies and users may change the setting.

PowerShell

Check the current value (read-only)

# --- Settings ---
$root = 'HKCU:'   # other signed-in user (elevated): 'Registry::HKEY_USERS\<SID>'

$key = "$root\Software\policies\microsoft\office\16.0\excel\security"
foreach ($name in @('extensionhardening')) {
    try   { '{0} = {1}' -f $name, (Get-ItemPropertyValue -Path $key -Name $name -ErrorAction Stop) }
    catch { '{0}: not configured' -f $name }
}

Admin rights needed: HKCU\Software\Policies is read-only for standard users. An elevated session writes to the admin's own HKCU – to set it for another signed-in user, change $root to Registry::HKEY_USERS\<SID>.

Enable

# --- Settings ---
$root = 'HKCU:'   # other signed-in user (elevated): 'Registry::HKEY_USERS\<SID>'

try {
    $key = "$root\Software\policies\microsoft\office\16.0\excel\security"
    if (-not (Test-Path $key)) { New-Item -Path $key -Force -ErrorAction Stop | Out-Null }
    New-ItemProperty -Path $key -Name 'extensionhardening' -PropertyType DWord -Value 0 -Force -ErrorAction Stop | Out-Null   # options: 0 = Allow different, 1 = Allow different, but warn, 2 = Always match file type
    'Done.'
}
catch { Write-Error "Failed: $($_.Exception.Message)" }
Reset to Not configured
# --- Settings ---
$root = 'HKCU:'   # other signed-in user (elevated): 'Registry::HKEY_USERS\<SID>'

$key = "$root\Software\policies\microsoft\office\16.0\excel\security"
Remove-ItemProperty -Path $key -Name 'extensionhardening' -ErrorAction SilentlyContinue
'Policy values removed (Not configured).'

Intune (settings catalog)

Force file extension to match file type (User)

Settings catalog → Add settings → search for the name above.

Intune Settings Catalog Viewer ↗

Alternative: custom profile (OMA-URI)
OMA-URI
./User/Vendor/MSFT/Policy/Config/excel16v2~Policy~L_MicrosoftOfficeExcel~L_ExcelOptions~L_Security/L_Forcefileextenstionstomatch
Data typeString
Value<enabled/> · <disabled/>

This policy has options: add one <data id="…" value="…"/> per element after <enabled/>. The element IDs are in the ADMX file.

Cloud Policy

Cloud Policy (config.office.com → Customization → Policy Management) offers many user policies of the Microsoft 365 Apps – search for Force file extension to match file type. It also applies to unmanaged devices and wins over GPO and Intune for the same setting.

Microsoft explanation

This policy setting controls how Excel loads file types that do not match their extension. Excel can load files with extensions that do not match the files' type. For example, if a comma-separated values (CSV) file named example.csv is renamed example.xls (or any other file extension supported by Excel 2003 and earlier only), Excel can properly load it as a CSV file.

If you enable this policy setting, you can choose from three options for working with files that have non-matching extensions:

- Allow different - Excel opens the files properly without warning users that the files have non-matching extensions. If users subsequently edit and save the files, Excel preserves both the true, underlying file format and the incorrect file extension.

- Allow different, but warn - Excel opens the files properly, but warns users about the file type mismatch. This option is the default configuration in Excel.

- Always match file type - Excel does not open any files that have non-matching extensions.

If you disable or do not configure this policy setting, if users attempt to open files with the wrong extension, Excel opens the file and displays a warning that the file type is not what Excel expected.

Same category: Microsoft Excel 2016 › Excel Options › Security

All policies in this category · All 173 policies of excel16.admx