PDF & Documents

Excel: "The File Format and Extension Don't Match"? Open It Safely (Don't Just Suppress It)

Published June 10, 2026 · by The FixHub Team

Opening a spreadsheet, Excel warns: “The file format and extension of ’…’ don’t match. The file could be corrupted or unsafe. Unless you trust its source, don’t open it.”

Why blindly silencing it is a bad idea: lots of posts tell you to set the ExtensionHardening registry value to 0 to make the warning disappear. Microsoft frames that as a security risk — the message can mean a renamed or malicious file, and turning the check off network-wide removes a real safeguard. Verify the source first, then open it the safe way.

Step 1: Decide if you trust the source

  • The warning is common and harmless when a file was generated/exported by another app or saved in an older format (the real content is fine).
  • It’s a red flag if the file arrived unexpectedly by email or its extension looks wrong (e.g. an .xlsx that’s actually something else). If you don’t trust it, don’t open it.

Step 2: Open and Repair (trusted file)

  1. In Excel: File → Open → Browse, select the file.
  2. Click the arrow next to the Open button → Open and Repair → Repair.
  3. Excel opens it and fixes minor format mismatches.

Step 3: Have the sender re-save it correctly

If it keeps warning, the file’s internal format doesn’t match its extension. Ask the sender to Save As the correct modern format (.xlsx), or try .xlsb/.xls if it’s legacy. That fixes the mismatch at the source.

Step 4: Only relax the warning for known-good sources

If you must stop the prompt for files you fully trust (e.g. a reporting tool’s output), adjust it narrowly — but understand you’re lowering a safety check. Prefer fixing the export format (Step 3) over the registry ExtensionHardening change.

FAQ

Why does this happen with files from our accounting/reporting system? Those often emit HTML or CSV with an .xls/.xlsx extension — a true format/extension mismatch. The fix is to export the real format, or use Open and Repair.

Is my data lost? Almost never — Open and Repair recovers it. The warning is about the container, not necessarily the data.

Sources: Microsoft Support — A file is in a different format than its extension indicates in Excel