Fix the "Removed Records Object XML" Error in Excel
Question details
The user needs to fix an error message regarding removed XML objects that appears when opening a specific Excel workbook.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- Opening a previously saved Excel workbook that contains corrupted worksheet sorting parameters.
- Observed behavior
- Excel displays an error stating 'Removed Records: Object from /xl/worksheets/sheet1.xml part' and strips out the corrupted sort data to open the file.
Create a backup copy of your corrupted Excel workbook before attempting to run any Visual Basic macros to clear the sort fields.
Clear Corrupted Worksheet Sort Fields via VBA
Clearing the corrupted sorting data on the affected worksheet using the Visual Basic Editor prevents the XML error from triggering upon opening the file.
This error is typically caused by invalid or corrupted sorting data applied to a specific worksheet (often Sheet1 or Sheet5). By using a simple macro command to clear the sort fields before saving, the broken XML record is removed cleanly.
Open the affected Excel workbook and press the 'ALT + F11' keys on your keyboard to launch the Visual Basic for Applications (VBA) Editor.
In the VBA Editor, press 'CTRL + G' to open the Immediate Window, which typically appears at the bottom of the screen.
Click inside the Immediate Window, type the command: Sheets("Sheet1").Sort.SortFields.Clear (replace "Sheet1" with the name of the corrupted sheet), and press Enter.
Close the VBA Editor, save your Excel workbook, close the application completely, and then reopen the file to verify the error is resolved.

Try WPS Office for Reliable Spreadsheet Management
If you frequently encounter corrupted XML errors or file recovery issues in Microsoft Excel, consider switching to WPS Office. It provides a lightweight, highly compatible alternative for viewing, editing, and managing your spreadsheets without heavy processing errors.
- 1. Download WPS Office: Visit the official WPS website and download the free WPS Office suite.
- 2. Open the Corrupted File: Launch WPS Spreadsheet and open the Excel file that was throwing the XML error.
- 3. Save as New File: Go to Menu > Save As and save the file as a new .xlsx document to generate a fresh, uncorrupted XML file structure.

Frequently Asked Questions
Why does Excel say "Removed Records: Object from /xl/worksheets/"?
This error occurs when the underlying XML code of the Excel file becomes corrupted. It is most commonly triggered by invalid, overly complex, or broken sorting rules applied to a specific worksheet. Excel removes these broken XML records automatically to force the file to open safely.
Will I lose my data when Excel removes these XML records?
Generally, no. Excel only removes the specific corrupted feature, such as a custom sort or filter applied to the affected sheet. Your core cell data, text, and formulas usually remain entirely intact.
How do I know which worksheet is causing the XML error?
The error message specifies the problematic sheet within its file path. For example, a message pointing to "/xl/worksheets/sheet1.xml" indicates that the worksheet named "Sheet1" contains the corrupted sorting data.
Can I prevent this XML corruption from happening again?
To prevent sorting-related XML errors, avoid applying overly complex multi-level sorts on massive datasets simultaneously, avoid saving files during system lag, and ensure your spreadsheet software is regularly updated to the latest version.




