TL;DR
Excel opened your file but showed a repair dialog β the .xlsx / .xls file has internal corruption. Work through these fixes from least to most destructive:
- Use File β Open β Open and Repair manually β you get more control over what gets removed.
- Copy all sheet data into a fresh workbook.
- If Excel already auto-repaired and you clicked OK, check the repair log it showed before you accepted β it lists exactly what got dropped.
What Actually Happened
When Excel shows:
Excel was able to open the file by repairing or removing the unreadable content
...the ZIP-based XML structure inside your .xlsx has one or more broken parts. Here's what typically causes it:
- File got truncated during a network save β SharePoint and mapped drives are the usual suspects.
- Two people had the same file open and one save partially overwrote the other.
- Anti-virus or backup software locked the file while Excel was still writing.
- The disk hit 0 bytes free mid-save. This happens more often than you'd think on shared drives.
- An old
.xlsfile from Excel 97β2003 with a damaged FAT structure.
Excel's auto-repair is silent. It drops whatever it can't parse β no warning, no undo. Depending on the damage, you can lose charts, pivot tables, conditional formatting rules, or entire sheets.
Step 1 β Read the Repair Log Before Clicking OK
Excel shows a collapsible repair summary before you get access to the file. Don't click OK yet. Click "Click here to see what content was removed" β it opens an XML log file listing everything that got axed. Save that log somewhere. You'll want it when your boss asks why the Q3 pivot table is gone.
Step 2 β Open and Repair Manually
Close the auto-repaired file without saving. Now do it yourself, with more control:
- Open Excel with no file loaded.
- Go to File β Open β Browse and navigate to the file.
- Click the dropdown arrow next to the Open button. Choose "Open and Repair".
- Try "Repair" first β it preserves formulas and formatting. Only pick "Extract Data" if Repair fails. Extract Data strips everything down to raw values.
Step 3 β Copy the File to a Local Path First
Network paths cause more false corruption reports than actual file damage. Before assuming data loss, copy the file locally and try again:
# Windows β copy from network share to local temp
copy "\\\\server\\share\\report.xlsx" "C:\\Temp\\report_local.xlsx"
# macOS
cp "/Volumes/NAS/report.xlsx" "~/Desktop/report_local.xlsx"
If the local copy opens without a repair dialog, the original problem was the network path β not corruption. Save the file back under a new name.
Step 4 β Inspect the XLSX Internals
An .xlsx file is just a ZIP archive with XML inside. You can crack it open and find exactly which part is broken:
# Windows (PowerShell)
Rename-Item report.xlsx report.zip
Expand-Archive report.zip -DestinationPath .\report_unzipped
# macOS / Linux
cp report.xlsx report.zip
unzip report.zip -d report_unzipped
Focus on these four files first β they cover 90% of corruption cases:
xl/workbook.xml # Workbook structure
xl/worksheets/ # One XML file per sheet
xl/sharedStrings.xml # All text cell values
xl/styles.xml # Cell formatting rules
Open them in VS Code. Truncated content or encoding errors near the end of the file are a dead giveaway. Small damage? Fix the XML by hand and re-zip:
# Re-zip after manual fix (Linux/macOS)
cd report_unzipped
zip -r ../report_fixed.xlsx .
Rename to .xlsx and test in Excel.
Step 5 β Restore a Previous Version
Sometimes the fastest fix is going back in time. Check these sources:
- OneDrive: right-click the file in OneDrive web β Version History β restore a version from before the corruption timestamp. OneDrive keeps up to 500 versions for Microsoft 365 subscribers.
- Windows File History: right-click the file in Explorer β "Restore previous versions".
- SharePoint: open the document library β select the file β Version History β restore.
Step 6 β Extract Raw Data With Python
If the file is too damaged for Excel's own repair, openpyxl is worth trying. It's more lenient with malformed XML than Excel is:
pip install openpyxl
import openpyxl
wb = openpyxl.load_workbook('report.xlsx', data_only=True, read_only=True)
for sheet_name in wb.sheetnames:
ws = wb[sheet_name]
print(f"--- Sheet: {sheet_name} ---")
for row in ws.iter_rows(values_only=True):
print(row)
You won't get formulas or formatting. But the raw numbers and text are often recoverable even when Excel gives up.
Stop This From Happening Again
- Save locally, copy back. When working on a network share, save to
C:\Temp\first, then copy the finished file back. This alone eliminates the majority of network-related corruption. - Set AutoRecover to 5 minutes: File β Options β Save. Make sure the AutoRecover location points to a local drive, not a network path.
- Stick to
.xlsxformat for anything important. The old.xlsbinary format corrupts far more easily. - On OneDrive, disable "Files On-Demand" for folders with active Excel files. A partially downloaded file triggers this exact error every time.
Verification
The fix worked when:
- Excel opens the file with no repair dialog.
- All sheets are present and the data matches what you expect.
- Formulas calculate correctly β hit
Ctrl+Alt+F9to force a full recalculation. - Charts and pivot tables render without errors.
Save the recovered file under a new name immediately. Don't overwrite the original until you've confirmed the data is intact.

