Yes, you can usually fix the "Excel cannot open the file because the file format or file extension is not valid" error without losing your data. The message means Excel cannot match the file's contents to its extension — most often because the file was saved in a different format than its name suggests, the extension is wrong, or the file is damaged. Working through the checks below resolves the majority of cases in a few minutes, starting with the safest options first. The steps below are for Excel on Windows desktop; menu labels can differ slightly between versions and on Mac.

What You'll Need

  • A Windows PC (or Mac) with Microsoft Excel installed
  • The problem file, plus any backup or emailed copy of it if one exists
  • Access to the folder the file is stored in
  • Five to ten minutes

Step-by-Step

  1. Make a copy of the file first. Right-click the file, choose Copy, then paste it into a different folder. Every repair attempt should be done on the copy so the original stays untouched.
  2. Check the extension matches the real format. Open File Explorer, go to the View tab and enable File name extensions so you can see the true extension. A common cause is a file named report.xlsx that is actually an older .xls file, a CSV, or even an HTML export. If someone renamed it, rename the copy back to the correct extension (for example .xls or .csv) and try opening it again.
  3. Try opening the file from inside Excel. Open Excel with a blank workbook, then go to File > Open > Browse, select the file, click the arrow next to the Open button and choose Open and Repair. Pick Repair first; if that fails, repeat and choose Extract Data, which pulls out the values and formulas without formatting.
  4. Set Excel's protected view aside for this one file. If the file came from the internet or an email attachment, Excel may be blocking it. Go to File > Options > Trust Center > Trust Center Settings > Protected View, temporarily untick the options there, click OK, and try the file again. Re-enable these settings straight afterwards — they exist to protect you from malicious files, so only do this for a file you trust.
  5. Check whether the file is blocked by Windows. Right-click the file, choose Properties, and on the General tab look for an Unblock checkbox near the bottom. Tick it if present, click OK, and try opening the file.
  6. Move the file out of untrusted locations. Files in temporary folders, download folders or synced cloud folders (OneDrive, Dropbox) sometimes fail while syncing. Copy the file to a local folder such as Documents and open it from there.
  7. Repair the Office installation. If every file fails, not just one, the problem may be Excel itself. Close Office apps, then open Windows Settings > Apps > Installed apps, find Microsoft 365 or Microsoft Office, click Modify and choose Quick Repair. If that does not help, run it again and choose Online Repair, which takes longer but reinstalls Office files properly.
  8. Open the file in another program to rescue the data. If the file still will not open, try importing it into Google Sheets (upload it to Google Drive, then open with Google Sheets) or LibreOffice Calc, both of which read damaged Excel files that Excel itself rejects. Then save or export it as a fresh .xlsx file.
  9. Change the file's association if double-clicking fails. If the file opens fine from inside Excel but not when double-clicked, right-click the file, choose Open with > Choose another app, select Excel and tick "Always use this app". This fixes a broken file association rather than a broken file.

Common Mistakes

  • Working on the original file. Repairs and renames can make things worse; always work on a copy.
  • Renaming the extension to force a format. Changing .xls to .xlsx with a rename only works if the file genuinely is that format underneath. If the file really is an older format, renaming it to .xlsx makes the error worse, not better — instead open it and use Save As to convert it.
  • Leaving Protected View disabled. Unticking the Trust Center options fixes the error but leaves you exposed; turn them back on immediately after.
  • Skipping the obvious. A file that is 0 KB was never fully downloaded or synced — re-download it or check the sender rather than repairing it.
  • Ignoring backups. Before spending an hour on repair, check OneDrive version history, email attachments or autosaved copies; a clean earlier copy is faster than any fix.

Tips

  • Excel's AutoRecover may hold a recent copy: check File > Info > Manage Workbook for available versions if the file was being edited on this PC.
  • Files over ~65,000 rows cannot be genuine .xls files — if a "xls" file is huge, it is likely a mislabelled file from another program, and importing it (Data > Get Data) often works better than opening it.
  • If the file came from a web application export, it may be HTML or CSV wearing an .xls name. Open it in Notepad first — if you see readable text or HTML tags, you know immediately what format it really is.
  • Extract Data in Open and Repair loses formatting, charts and macros but keeps values, which is usually what matters most.

Troubleshooting

If Open and Repair fails on every attempt: the file structure is likely badly damaged. Move straight to step 8 and open it in Google Sheets or LibreOffice, then re-save a clean copy.

If only this one file fails: the file is the problem — focus on steps 2, 3 and 8. If all files fail: Excel is the problem — focus on step 7, and make sure Office is fully updated via File > Account > Update Options.

If the file is on a USB drive or network share: copy it to the local disk first; corrupted transfers are a common cause of this exact error.

If none of the above works: check for a previous version — right-click the file (or its folder) and look for a "Restore previous versions" option if File History or a similar backup is in use. As a last resort, commercial Excel repair tools exist, but try the free options here first and never run such tools on your only copy.

Frequently Asked Questions

Can I recover an Excel file that shows "not valid"?

Usually yes. Open and Repair, Google Sheets or LibreOffice recover the data in most cases, even when Excel itself refuses the file. Badly damaged files may lose formatting or formulas but often keep the values.

Why does Excel say the format is not valid when the extension looks right?

The extension is only a label; Excel inspects the actual file contents. If a file was renamed, exported by another program with a misleading extension, or corrupted during download, the contents will not match the name and Excel rejects it.

Will Open and Repair delete my data?

No — it only writes a repaired copy when you save. Nothing in the original changes unless you overwrite it, which is why working on a copy is still recommended.

Does this error mean the file has a virus?

Not necessarily. Most cases are format mismatches or corruption, but because malware sometimes disguises itself as a spreadsheet, only open files from sources you trust, and keep Protected View enabled for files from the internet.

Can I convert an .xls file to .xlsx by renaming it?

No. Renaming does not convert anything. Open the file in Excel (or LibreOffice) and use File > Save As, choosing the Excel Workbook (.xlsx) format.