Nothing's more frustrating than finding out that the Excel file on which you were working for so many weeks is now in a corrupted state. In this case, you may lose extremely important business or personal data. But wait! The good news is that most corrupted Excel files are repairable. There could be one or more reasons that may lead to a corrupted Excel file. In this tutorial, we'll learn all the methods to repair such files. We'll also learn about the ways to prevent or minimize Excel file corruption in the future. So, if you are struggling to recover data from your corrupted Excel file, follow this guide right now!
We'll start with the built-in methods, then go to different manual methods, and finally look into 3rd-party recovery software. This way you'll have multiple options to recover the data.
Remember, most Excel files are fully recoverable provided you know how to do it. So, don't panic if you have a corrupted Excel file that contains critical data. Just read this tutorial. Let's get started!
Why Do Excel Files Get Corrupted?
Before learning all the methods to fix this issue, let's see some of the reasons that lead to Excel file corruption. Knowledge about these reasons will help you pick the right method or tool to fix the issue.
- Sudden power loss or a PC crash: While Excel is writing or saving the data, if the computer crashes or there's a power failure, file corruption may happen.
- Network failure while syncing: A cloud account file-syncing operation over a poor network connection can corrupt the file.
- Disk malfunction: Storage device hardware failure is one of the reasons for file corruption.
- Too complex or huge file: Creating a complex sheet with a lot of pivot tables, complex macros, or too many embedded objects can lead to file corruption.
- Conflict with a 3rd-party plugin: A poorly coded or conflicting Excel add-in can be one of the reasons the file may get corrupted.
- Malware infection: Infection from malware targeting Office documents is another primary reason.
- File format mismatch: Suppose you've created a
.csvin an old version of Excel, and now changing the extension to.xlsxfor editing in a newer version. This will apparently corrupt the file.
Remember, .xlsx files are essentially ZIP files consisting of a collection of XML files. This knowledge will help you recover data through one of the methods given below.
Step 1: Try Excel’s Built-In "Open and Repair" Tool First
The first method you should try is to use Excel's own repair tool that can fix a good number of corruption issues. Here's how to use this feature:
How to Use Open and Repair
- First, open a blank spreadsheet in Excel.
- Go to the File → Open option.
- Click Browse and select the corrupted file. Do not double-click on it.
📷 Select Open and Repair - Click and open the dropdown menu present in the Open button.
- Select the Open and Repair... option from the dropdown menu.
📷 You get two options to recover your file or data - You'll get two options, viz., Repair and Extract Data.
- Choose the Repair option first, as it attempts to recover as much data as possible.
- If this doesn't work, choose the Extract Data option. It'll attempt to recover all the data and formulas.
If the recovery attempt is successful, save the file with a new name to avoid accidentally overwriting it on the original file.
If both the options do not give the desired results, move on to the next step.
Step 2: Recover an Unsaved or Lost Version
Sometimes, the file is not corrupted. An Excel file may fail to track the AutoSave or AutoRecover version.
Using AutoRecover
- Open the Excel file and go to the File → Info option.
- You'll find a Manage Workbook option. Sometimes, it is also labeled as Manage Versions.
📷 Recover unsaved versions of an Excel file - Click it, and select the Recover Unsaved Workbooks option from the drop-down menu.
- From the file selection dialog box, select the unsaved workbook you want to recover.
Manually Locating AutoRecover Files
If the previous option doesn't show any recovery workbooks, you can manually find the recovery files, if any.
Windows path (typical):
C:\Users\<YourUsername>\AppData\Roaming\Microsoft\Excel\
Mac path (typical):
~/Library/Containers/com.microsoft.Excel/Data/Library/Preferences/AutoRecovery/
Here, look for the files with extensions like .xlsb, .tmp, or the ones prefixed with ~. Copy them to the desktop and then open in Excel.
Step 3: Change the File Format to Force a Rebuild
Another handy trick worth trying is to change the file format to force Excel to try a different parsing engine to extract the data. Remember, this method only works for files with minimal damage.
The CSV/SYLK Conversion Trick
- First, right-click the
.xlsxfile and change its extension to.csv. Now, in Excel’s file opening dialog box, choose the All Files option from the dropdown menu and select the.csvfile. - If the
.csvtrick doesn't work, try the.slk(SYLK format) extension instead. This method can help you recover raw data without any formatting.
Remember, both these tricks only work for files that are not heavily corrupted.
Step 4: The ZIP Trick: Manually Extracting Data from .xlsx Files
As I mentioned earlier, .xlsx files are ZIP files under the hood consisting of XML files. We'll take advantage of this fact and will directly access these XML files to extract the data.
How to Do It
- First, make a copy of the corrupted file. Always keep the original corrupted version safe to be used in other methods.
- Rename the file's extension from
.xlsxto.zip. - Use your preferred archive tool (7-Zip, WinRAR, or macOS Archive Utility) to open the ZIP file.
- Browse the folder where the content has been extracted.
/xl/worksheets/sheet1.xml /xl/worksheets/sheet2.xml /xl/sharedStrings.xml - Open the
.xmlfiles in your favorite text editor or in a web browser. - The
sharedStrings.xmlfile contains the text values of your Excel file. You can manually scan its content to see if it's the same data you want to recover.
What You’re Looking For
- If the XML files are readable, your chances of data recovery increase by manyfold.
- But if the XML files look scrambled and unreadable, this method won't work.
Rebuilding a Clean File From Salvaged XML
If you see the XML files are largely readable, here's how to rebuild a clean version:
- First of all, create a new
.xlsxfile in Excel and save it. - Rename this new file, changing its extension to
.zip. Extract it through a file archiving tool that gives you an empty folder skeleton. - Now start replacing the new file’s
sheet1.xmlandsharedStrings.xmlwith the recovered XML files from the corrupted version. - Now zip the contents of the new file's extracted folder. Remember, zip the files and not the parent folder.
- Change the extension of this zipped file back to
.xlsxand try to open it in Excel.
This is a powerful recovery method, but requires patience and a careful approach.
Step 5: Try a Different Application to Open the File
Sometimes, the culprit is not the file, but Excel itself. Try other spreadsheet applications, as their file parsers may not be as stringent as Excel.
Try the following applications to open the corrupted file:
- Google Sheets: Its parser is not as strict as Excel's. Try opening the file in it.
- LibreOffice Calc: It is known for easily opening Excel files with minor damage.
- WPS Office Spreadsheets: This one also has a different parser. No harm in trying it once.
If any of these applications successfully open the file, make sure to save it as a new Excel file to get the clean version.
Step 6: Recovering Data When the File Won’t Open At All
If none of the steps mentioned above are working, the only option left is to use dedicated data recovery software to extract whatever data is possible.
Options at This Stage
- Data recovery software: Applications like Recuva or Disk Drill can help you recover deleted or older versions of your Excel file.
- Check for backups: Use Time Machine on Mac, or File History on Windows to recover the older version of the corrupted file.
- Check your email or chat history: Another place to look for working copies of the file is chat history or your email account.
- Ask collaborators: If multiple people are working on the same file, there is a high chance one of them has a working copy.
If everything fails and the data is too important, the final step is to hire a data recovery expert.
Conclusion
An error in your Excel document can be small or big. You can still recover some or all of its data by using Excel’s own built-in repair system, the history feature of its cloud version, converting to another format and then converting back again, extracting manually from XML, or with dedicated software.
So next time your Excel file gives an error, make a copy of the file and execute the steps given above to retrieve its content.