Excel File Cannot Open Because the File Format Is Invalid

How-to basics · Updated November 2, 2026

Excel File Cannot Open Because the File Format Is Invalid

Excel’s “file format or file extension is not valid” message usually means Excel cannot reconcile the filename’s extension with the file’s actual contents, or the workbook is damaged or incomplete. Check the file’s source and extension first; then, in Excel for Microsoft 365 on Windows, try File > Open > Browse and Open and Repair on a copy.

What the file-format error means

An extension such as .xlsx or .xls tells Windows and Excel what kind of file they are expected to handle. The extension is part of the filename; it does not convert the contents. An Excel workbook named Budget.xlsx should contain workbook data in a format Excel recognizes. If it actually contains a different type of data, has been truncated during download, or is damaged, Excel may reject it with a format-or-extension error.

The message is a clue, not a diagnosis. A mismatch is common, but corruption, an interrupted transfer, an unsupported format, or a file that is not really an Excel workbook can lead to similar trouble. The file may have come from a website, email attachment, export tool, shared folder, or another spreadsheet program, so its source matters.

Do not assume that the workbook is permanently lost. First preserve the original, then check simple causes before attempting repair. Opening a damaged file repeatedly or saving over the only copy can make recovery harder.

Know which Excel formats you have

Excel for Microsoft 365 on Windows supports common workbook formats including .xlsx, .xlsm, .xlsb, and the older .xls format. The extensions indicate different capabilities: .xlsm can contain VBA macros, .xlsb is a binary workbook format, and .xls is the Excel 97–2003 workbook format. Excel also works with formats such as CSV and templates, but they do not all preserve the same workbook features.

A CSV file, for example, stores tabular text rather than a complete Excel workbook. It does not preserve multiple worksheets, charts, formatting, or formulas as workbook features. If a CSV is renamed to .xlsx, the name changes but its contents remain CSV text; Excel may then report that the format does not match. To make an actual .xlsx workbook, open the CSV in Excel and use Save As to select an Excel workbook format.

Likewise, a file produced by another application may use its own format even if its name looks familiar. The safest route is to use the application that created it and export or save a copy in a format Excel supports. Simply adding or changing an extension is not a conversion.

Check the filename, source, and file size

Start with basic checks that do not change the file. Confirm that the download finished and that the file is not unusually small or 0 KB. If it arrived as an email attachment, download it again rather than opening a preview. If it is stored on a network drive or in a cloud-synced folder, copy it to a local folder and wait for synchronization to finish before trying again.

Windows can hide extensions, making it easy to mistake a name such as Report.xlsx.csv for Report.xlsx. In Windows 11 File Explorer, choose View > Show > File name extensions. In Windows 10, use the View tab and select File name extensions. Then inspect the entire filename. Do not remove an extension just because it looks unexpected: first check with the sender or the program that created the file.

  • Compare the extension with the type the sender said they provided.
  • Check whether the file was downloaded completely and has a plausible size.
  • Ask the sender to confirm the original format or send the file again.
  • If the file came from an export, repeat the export and choose an Excel workbook format where appropriate.

A useful example: if a system exports sales data as sales.csv but someone renames it sales.xlsx, changing the extension back to .csv may let Excel open the text data. It will not restore workbook features that were never present. If you are unsure what the file really is, ask for a fresh export rather than guessing at extensions.

Try Open and Repair in Excel for Windows

If the extension appears correct and the file should be an Excel workbook, use the built-in repair option. Make a duplicate of the file first and work on that copy. The exact command is available in the desktop Excel app for Windows; Excel for the web does not provide the same desktop Open and Repair workflow.

  1. Open Excel, then choose File > Open > Browse.
  2. Select the copy of the workbook in the file picker. Do not double-click it to open normally.
  3. Select the arrow beside the Open button and choose Open and Repair.
  4. Choose Repair. If Excel cannot repair the workbook, repeat the process and choose Extract Data if that option is offered.
  5. If Excel opens or extracts content, save the recovered result under a new name and in an appropriate workbook format.

Repair attempts to restore workbook structure. Extract Data is a fallback that may recover values and formulas even when the complete workbook cannot be restored. Neither option guarantees recovery, and a repaired file may not retain every chart, format, link, or other feature. Keep the damaged original until you have checked the recovered copy.

If Excel opens the repaired workbook, review important sheets, formulas, dates, and totals rather than assuming the result is complete. A file can open successfully while still missing content. For business-critical information, compare the recovered workbook with a previous version, a source export, or the sender’s copy.

If repair does not work

Try to obtain another copy from the source. Re-download the file, ask the sender to attach it again, or export it again from the original application. If a previous version exists in a backup or cloud version history, restore or download that version as a separate file. These options are often more dependable than repeatedly trying to repair a badly damaged copy.

Check that you are opening the original file rather than a shortcut, temporary download, or partial sync copy. If the workbook is on a shared drive, copy it to a local folder and try again. Make sure you have permission to read the file and that another process is not still writing or uploading it. A network interruption can leave a file that has the right name but incomplete contents.

If another spreadsheet application can open the file, use it to save a new copy in .xlsx format, then test that copy in Excel. This can sometimes help with compatibility, but it may alter formatting, formulas, macros, or features specific to the original program. Keep the original unchanged and review the converted copy carefully. Do not use a text editor to rewrite a binary workbook; that is not a repair method.

Separate format errors from security warnings

Files from the internet or email can trigger security protections in Office. A Protected View banner or a warning about macros is not the same as a file-format error, even though both can prevent normal editing. Do not disable Protected View globally or enable macros simply to get past an opening problem.

Only proceed if you trust the source and expected the file. Windows may show an Unblock option in a downloaded file’s Properties, but removing a security block does not repair a mismatched or damaged workbook. If the file’s origin is uncertain, confirm it with the sender through a separate, trusted channel before changing security settings or opening active content.

Also distinguish this message from a password prompt, a permissions error, or a notice that a file is locked for editing. Those point to different issues. Read the complete error text and note whether Excel identifies the file as blocked, password-protected, read-only, or invalid; the wording helps choose the right next step.

Excel for Mac and Excel for the web

The steps above describe Excel for Microsoft 365 on Windows. Excel for Mac has different menus and file-picker controls, so the Windows File > Open > Browse sequence and Open and Repair button may not match its interface. On a Mac, try opening a fresh local copy with File > Open and follow any repair prompt Excel provides. If the workbook remains unreadable, use a backup or ask for a fresh copy; do not assume that a Windows repair command is available on Mac.

Excel for the web can open many supported workbook files stored in OneDrive or SharePoint, but it does not offer the desktop Open and Repair tool. If a web copy fails, download a separate copy and try the desktop app. Conversely, if the desktop file is sound but its cloud copy has not finished syncing, wait for synchronization or upload a fresh copy before drawing conclusions about the file format.

Prevent the error next time

When sharing or exporting a workbook, choose the intended file type in the creating application instead of renaming the file afterward. Use .xlsx for a standard workbook without VBA macros, .xlsm when a workbook needs to retain VBA macros, and CSV only when plain tabular data is sufficient. If a recipient needs an older Excel format, confirm that requirement before saving to .xls, since older formats can have feature limitations.

  • Keep an unchanged original before converting or repairing a workbook.
  • Let downloads and cloud uploads finish before opening or forwarding files.
  • Use Save As or the source application’s export feature to convert formats.
  • Ask the recipient to confirm the extension and whether macros or multiple sheets must be retained.

These habits prevent a common misunderstanding: the filename tells Excel what format to expect, but only the file’s contents determine what it actually is. Matching the extension to the real format is important; it cannot, by itself, restore missing or corrupted data.

Frequently Asked Questions

Can I fix the error by changing .xlsx to .xls?
No, not unless the contents are already a genuine .xls workbook and the extension was simply wrong. Renaming does not convert a workbook. Use the application that created the file to export or save a compatible copy.

Does Open and Repair always recover an Excel file?
No. It can repair some workbook damage or extract some data, but recovery is not guaranteed. Work on a duplicate, and compare any recovered content with a backup or source file.

Why does Excel say the format is invalid when the file ends in .xlsx?
The extension can be correct-looking while the contents are incomplete, damaged, or in another format. A hidden second extension, an interrupted download, or a file renamed without conversion are common possibilities.

Can I open a CSV file in Excel?
Yes. Excel can open CSV data, but CSV is not a full workbook format and does not retain features such as multiple worksheets, charts, or workbook formatting. To keep Excel workbook features, save the data as an Excel workbook from Excel.

Is it safe to enable editing or macros to fix the error?
Those actions do not repair a format mismatch. Only trust a file from a source you recognize, and enable macros only when you know they are needed and safe. Treat security warnings separately from format troubleshooting.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.