You double-click a file and Excel stops with:

The file format and extension of ‘report.xls’ don’t match. The file could be corrupted or unsafe. Unless you trust its source, don’t open it. Do you want to open it anyway?

Click Yes and one of three things happens: the workbook opens perfectly, you get a grid full of HTML tags, or you land in the repair dialog. Same message, three different causes. The extension is usually the liar, not the data.

What the dialog actually checks

Excel ignores the file name and reads the first bytes to work out the real container, then compares that against the extension. Two signatures cover almost every Office file:

  • 50 4B 03 04 — a ZIP archive, which is what .xlsx, .xlsm, .docx and .pptx really are.
  • D0 CF 11 E0 A1 B1 1A E1 — the older OLE2 compound file used by .xls, .doc and .ppt.

A ZIP header under an .xls name triggers the warning. So does an OLE2 header under .xlsx. So does a file that is neither — an HTML page or a text dump saved with an Excel extension.

The “could be corrupted” half is a separate claim. A file cut off mid-download can still carry a valid header with no readable directory at the end. The check is shallow, so treat the dialog as a hint about the container, never as a diagnosis of the contents. Note the platform gap: Excel for Mac often opens the same file silently, with no dialog at all.

Check the real format before you click Yes

Work on a copy, never the original. Paste a duplicate as report-copy.xls and read its first bytes in PowerShell:

Format-Hex -Path 'C:\Temp\report-copy.xls' -Count 8

50 4B means a ZIP container, D0 CF 11 E0 means OLE2, and anything else — including 3C 21 44 4F, the ASCII opening of an HTML doctype — means the file is HTML or plain text wearing an Excel name.

The second check costs nothing: right-click the copy, Open with → Notepad. If the first screen shows the word “html”, a table tag or an XML declaration, no repair tool will help — that is the export case, and it has its own fix below.

Fix 1 — Give the file the extension it actually has

Rename the copy to match its header, then open the copy. Header 50 4B with a .xls name becomes .xlsx; header D0 CF 11 E0 with a .xlsx name becomes .xls. Windows warns that changing the extension may make the file unusable — accept, because you are renaming a copy.

Renaming repairs nothing; it only stops Excel from second-guessing a file whose contents are fine. If the file was truncated, renaming moves you past this dialog and into the unreadable-content message, which is progress: the container is intact, the data is not.

One case deserves a warning. If the header is ZIP and the real file is a macro workbook, renaming it to .xlsx makes Excel drop vbaProject.bin the moment you save, with no prompt. Check first by naming it .zip, opening it, and looking for an xl/ folder containing vbaProject.bin. If it is there, the correct extension is .xlsm.

Fix 2 — Open and Repair on the copy

Once the extension matches, run one repair pass on the copy: File → Open → Browse → select the file → click the small arrow next to Open → Open and Repair. If Excel cannot repair it, the same dialog offers Extract Data. Take it, but know the cost: values and cell positions survive; formatting, charts, merged cells and live formulas usually do not. Save the result under a new name.

Do not run this on the original: repair writes to the file it works on, and a second pass on a mangled workbook tends to return empty sheets.

Fix 3 — When the file is HTML or text with an .xls name

Bank statements, ticketing systems and older ERP exports are the usual source. Renaming to .html and opening it in a browser shows the table, but copy-paste mangles dates and decimals. Import it instead: Data → Get Data → From File → From Text/CSV → pick the file → set the delimiter → set each column’s type by hand before loading.

For genuine HTML, save it as .html and pull it in through Data → Get Data → From Web with the local path, or export a clean CSV from the browser — that route also avoids the encoding problems in CSV garbled characters in Excel.

Fix 4 — Unblock files that came from email

Attachments and browser downloads carry a mark-of-the-web, which pushes the file into Protected View, where the format check fires alongside a read-only banner. Right-click the file → Properties → General tab → tick Unblock → OK → reopen. To review which of the three Protected View checks are on: File → Options → Trust Center → Trust Center Settings → Protected View.

Is the ExtensionHardening registry key worth it

Under HKEY_CURRENT_USER\Software\Microsoft\Office\16.0\Excel\Security, a DWORD named ExtensionHardening set to 0 silences the check. Match 16.0 to your Office version. Close Excel fully before and after.

It is worth it only for a folder of files you have already verified. It changes nothing about the file: HTML still renders as HTML, a truncated file still lands in the repair prompt. On a managed laptop a policy value under HKCU\Software\Policies overrides it, so the change may not take effect at all.

When it is not worth fixing

  • A few kilobytes where there should be megabytes. The download never finished. Fetch it again; no repair recovers bytes that were never written.
  • Valid header, unreadable ZIP directory. The file was cut mid-write. Sheets written before the cut may survive; later ones will not.
  • Repair returns the right sheet count with empty cells. Automated repair has nothing left to give; further attempts rewrite the same empty parts.

If the workbook holds months of manual entry and repair output is empty, it needs structural work, not another button press — that is what the file repair service is for.

FAQ

Can I just click Yes and open it anyway? For a renamed-but-intact file, yes — opening modifies nothing. The danger is the Save afterward: Excel writes in the format the extension claims, so a macro workbook opened as .xlsx and saved loses its macros. Open the copy and use Save As to a new name.

Does this message mean the file has a virus? No. The check compares container signatures and nothing else. The real risk case is a macro-enabled workbook from an unknown sender — a reason to be careful about enabling content, not about this dialog.

Why does the same file open fine for a colleague? They may be on Excel for Mac, which often skips the check; the folder may be registered as a Trusted Location, which bypasses both Protected View and the format check; or their copy arrived without the mark-of-the-web.

Still stuck? Email the file to help@easyofficefix.com with the exact error text. You get an assessment and a flat price before any work starts.