Quick answer: Excel may show “Excel cannot open the file because the file format or file extension is not valid” when the extension at the end of the file name doesn’t match what is inside the file, or when the contents are damaged. Turn on file name extensions in File Explorer and check that a real workbook ends in .xlsx, .xlsm, .xlsb or .xls. If the name looks right, open the file from File > Open in Excel, select the arrow next to Open and choose Open and Repair. If that fails, restore an earlier version from OneDrive or File History.
In this guide
- What the message means
- Match your symptom
- Fix 1: Check the real file extension
- Fix 2: Open the file from inside Excel
- Fix 3: The file came from another program
- Fix 4: Protected View or a blocked file type
- Fix 5: Run Open and Repair
- Fix 6: Pull the data out of a workbook that won’t open
- Fix 7: Restore an earlier version of the file
- Fix 8: Every workbook fails? Repair Office
- Protect your workbooks next time
- Related guides
Applies to: Excel for Microsoft 365, Excel 2024, 2021 and 2019 on Windows 11 and Windows 10. Before you start: copy the problem file to a new folder and work on the copy, so a failed repair can’t make things worse.
What the message means
Every Excel format has its own internal structure. An .xlsx file is XML-based, while .xls and .xlsb are binary formats, according to Microsoft’s list of file formats supported in Excel. As general guidance, Excel reads the extension first and expects the matching structure. When it finds something else, such as text, a web page, a file from another app or a half-written download, it may stop with this message instead of guessing.
That gives two broad causes: the name is wrong but the data is fine, or the data itself is damaged. The first is quick to fix. The second needs repair or an older copy.
Match your symptom
Pick the line closest to what you see.
| What you see | Where to look | Go to |
|---|---|---|
| You or a script renamed the file recently | Extension doesn’t match the contents | Fix 1 |
| Double-clicking fails, but the file opens on another PC | File association or default app | Fix 2 |
| The file was exported from a website, a database or another spreadsheet app | Different format with an Excel extension | Fix 3 |
| A yellow or red bar, or a message that a problem was detected | Protected View or File Block | Fix 4 |
| The file opened yesterday and fails today, or the size is 0 KB | Damaged contents | Fixes 5, 6, 7 |
| Every workbook fails, even new ones | Office install | Fix 8 |
Fix 1: Check the real file extension
As general guidance, Windows hides extensions by default, so a file can look like Budget while its real name is Budget.xlsx.csv or Budget.xls when it was saved as something else. To see the full name in Windows 11:
- Open File Explorer and go to the folder with the file.
- Select View > Show > File name extensions. In Windows 10, select the View tab and tick File name extensions.
- Look at the end of the name. Two extensions, or an extension that doesn’t belong to Excel, may explain the error.
If you know what the file really is, rename it back. Select the file, press F2, change only the part after the last dot and press Enter. Windows warns that the file might become unusable; that is expected when you change an extension.
When you don’t know the original format, try these extensions in turn on your copy: .xlsx, then .xls, then .csv. Renaming only changes the label, not the data, so it can’t convert a file. If one extension opens cleanly, save the result in a proper format with File > Save As.
Note: a macro-enabled workbook needs .xlsm. Microsoft says .xlsx can’t store VBA macros, so renaming a macro workbook to .xlsx may trigger this same error.
Fix 2: Open the file from inside Excel
If the file opens on another computer, or from inside Excel but not with a double-click, Windows may be handing it to the wrong app or to an old Office version. Start Excel, select File > Open, browse to the file and open it from there. If that works, set Excel as the default app for the extension, as shown in our guide to changing default apps in Windows 11. As general guidance, you can do it per file type under Settings > Apps > Default apps by searching for .xlsx and choosing Excel.
Files stored in a synced folder are another case. As general guidance, a OneDrive file that hasn’t finished downloading may open as an incomplete file. Wait for the sync icon to show the file as available, or right-click it and choose Always keep on this device, then try again.
Fix 3: The file came from another program
Some websites, banking portals and reporting tools may export plain text, HTML or XML and still name the file .xls or .xlsx. As general guidance, if you open the copy in Notepad and see readable rows separated by commas, tabs or HTML tags, the file isn’t a real workbook. Rename it to .csv or .txt and open it in Excel, or use Data > From Text/CSV to import it with control over delimiters and encoding.
Microsoft’s file formats article also lists formats Excel can’t open at all, including Lotus 1-2-3 (.wk1 to .wk4, .wks), Microsoft Works (.wks), DBF 2 and Quattro Pro (.wq1, .wb1, .wb3). For those, Microsoft suggests saving the file from the original program in a format Excel supports, or using a file converter. OpenDocument files (.ods) do open, though Microsoft notes some formatting may be lost.
A text export may keep only one sheet and no formatting. Microsoft states that saving a workbook in any text format loses all formatting, so save the imported data as .xlsx before you start working on it.
Fix 4: Protected View or a blocked file type
Excel can open files from the internet, email attachments and unsafe folders in Protected View, a read-only mode. Microsoft’s Protected View article says a file also lands there when it fails a validation check because its structure changed, and that this message can point to a malicious file but also to a damaged file, a disk problem or a faulty transfer. Older 97-2003 formats such as .xls may also trigger validation errors.
- If a yellow bar appears and you trust the file, select Enable Editing.
- If the bar is red, Microsoft’s path is File > Edit Anyway, again only for a file you trust.
- If the file arrived unexpectedly or looks odd, don’t edit it. Microsoft advises closing and deleting it, and checking with the sender by phone or a separate email first.
The Protected View settings sit under File > Options > Trust Center > Trust Center Settings > Protected View. Microsoft recommends checking with your administrator before you change them, and turning them off to get past one file weakens protection for every file. A file type blocked by File Block policy may refuse to open or edit at all; on a work PC that is your IT team’s call.
Fix 5: Run Open and Repair
When the name is right and the file still fails, its contents may be damaged. Microsoft’s repair a corrupted workbook article says Excel starts File Recovery mode by itself when it detects damage, and gives this manual route when it doesn’t:
- In Excel, select File > Open and browse to the folder with the workbook (in current versions, select Browse to get the Open dialog).
- Select the workbook, but don’t double-click it.
- Select the arrow next to Open, then Open and Repair.
- Choose Repair to recover as much as possible. If that fails, run it again and choose Extract Data to pull out values and formulas.
Microsoft also suggests moving the file to another local disk first when a disk or network error stops it opening. As general guidance, copying a file from a network share or USB stick to your desktop rules out the connection. Save a repaired file under a new name so the original stays untouched.
Fix 6: Pull the data out of a workbook that won’t open
If Open and Repair gives up, Microsoft’s repair article lists more ways to rescue the data.
Set calculation to manual
Create a blank workbook, go to File > Options > Formulas, set Calculation options to Manual and select OK. Then open the damaged file with File > Open. With nothing recalculating, Excel may get further through the file.
Link to it with an external reference
In a new workbook, type a formula in cell A1 that points to the first cell of the damaged file, for example =Budget!A1 with the file name and no extension, and pick the sheet when Excel asks. Fill the formula across and down to cover the data, copy the range and paste it back with Home > Paste > Values to drop the links. This brings back values only, not formulas or formatting.
For a chart linked to the damaged workbook, the same article includes a GetChartValues macro that writes the chart’s data to a sheet named ChartData. Microsoft also mentions third-party recovery software as an option; as general guidance, try it on a copy and be wary of tools that charge before showing what they can recover.
Fix 7: Restore an earlier version of the file
An older healthy copy is quicker than any repair. As general guidance, check these places:
- OneDrive or SharePoint: right-click the file on the OneDrive website and select Version history, then restore a version from before the problem.
- File History or a restore point: in File Explorer, right-click the file, select Properties and open the Previous Versions tab. It lists copies only if File History or system protection was turned on.
- Excel’s own backup: if Always create backup was on, a file named
Backup ofplus the workbook name may sit in the same folder. - Email and downloads: the copy you sent or received may still be intact.
If the file was deleted or overwritten rather than damaged, our guide to free file recovery on Windows covers the Recycle Bin, File History and recovery tools.
Fix 8: Every workbook fails? Repair Office
If new workbooks you save also refuse to open, the cause may be the Office install rather than the files. Run a Quick Repair or Online Repair of Microsoft Office from Settings > Apps > Installed apps. If Excel opens files but then freezes, see Excel not responding instead, which covers add-ins and safe mode.
Protect your workbooks next time
Microsoft’s repair article describes two settings that make the next failure less painful:
- Keep a backup copy: in File > Save As, select Browse, then Tools > General Options and tick Always create backup.
- Save AutoRecover data: under File > Options > Save, tick Save AutoRecover information every and set the minutes (10 by default), and make sure Disable AutoRecover for this workbook only is cleared.
Saving to OneDrive adds version history and AutoSave. If AutoSave won’t turn on, see Excel AutoSave not working. And when you need a different format, use File > Save As and pick the type there instead of renaming the extension by hand.
Related guides
- How to repair Microsoft Office (Quick Repair and Online Repair)
- Free file recovery on Windows 11 and 10: 4 ways to get deleted files back
- How to change default apps in Windows 11 (browser, PDF, photos)
- Excel AutoSave not working: how to fix it
- Excel not responding: how to fix freezes and hangs
Leave a Reply