Fix Excel Crashes After Removing an XML Source from a Workbook
Question details
The user needs to stop an Excel workbook from crashing after an XML map or XML data source was removed.

- Product
- Microsoft Excel
- Device & OS
- not provided
- Scenario
- An XML source, map, or imported XML data connection was deleted from a workbook.
- Observed behavior
- Excel becomes unstable or crashes because the workbook may still contain references to the removed XML source.
Close the workbook and reopen it only after identifying the deleted XML map, query, or connection if possible. Use a separate working copy while checking workbook objects so you can test each cleanup change safely.
Remove connections and queries that reference the deleted XML source
Use this method when the workbook used XML imports, Power Query, or external data connections before the XML source was removed.
A deleted XML source can leave a connection or query that tries to refresh unavailable data when the workbook opens. Removing or updating these items can prevent Excel from crashing during loading or refresh.
In Excel, open the workbook and choose not to refresh external data if you are prompted. If it crashes immediately, start Excel in Safe Mode by holding Ctrl while opening Excel, then open the file.
Go to Data > Queries & Connections. On the Connections tab, select connections associated with the removed XML file, XML URL, or old data source, then choose Remove or Properties to update the source.
Go to Data > Queries & Connections and select the Queries tab. Right-click any query that imports or transforms the deleted XML data, then choose Edit to change its source or Delete if it is no longer needed.
Go to Data > Edit Links, if available. Select links that point to the deleted XML-related source or unavailable workbook and choose Break Link or Change Source as appropriate.

Delete obsolete names, formulas, and validation rules
Use this method when the XML source supplied named ranges, list values, lookup formulas, or validation lists.
Repair the workbook or move unaffected sheets to a new file
Use this method if Excel still crashes after XML references have been removed or if the workbook cannot remain open long enough to edit it.
Open and rebuild the affected workbook with WPS Office Spreadsheets
If Microsoft Excel continues to crash after an XML source is removed, WPS Office provides a free, lightweight spreadsheet alternative with a familiar interface. Open the workbook in WPS Spreadsheets, inspect usable sheets and formulas, then save a clean copy for continued work or migration.
- 1. Install WPS Office: Download and install WPS Office, then open WPS Spreadsheets from the WPS Office home screen.
- 2. Open the Excel workbook: Select Open and choose the affected .xlsx or .xls file. If the workbook opens, review the worksheets that contain usable data.
- 3. Create a clean workbook: Choose Menu > New to create a spreadsheet, then copy usable worksheet data into the new file as needed.
- 4. Save in Excel format: Choose Menu > Save As and select Excel Workbook (*.xlsx) to keep the rebuilt file compatible with Microsoft Excel.

Frequently Asked Questions
Why does Excel crash after I delete an XML map?
Excel may still attempt to load a connection, Power Query query, defined name, formula, validation rule, or external link that refers to the removed XML source. Remove or update those references from Data > Queries & Connections, Formulas > Name Manager, and Data > Data Validation.
Where can I remove XML-related data connections in Excel?
Go to Data > Queries & Connections and open the Connections tab. Select a connection related to the deleted XML source and choose Remove, or open Properties to point it to a valid source.
How do I find broken named ranges after deleting XML data?
Go to Formulas > Name Manager. Look for names containing #REF! or names that reference the removed XML range, then select them and click Delete or edit the Refers to field.
Can Open and Repair fix an Excel workbook that crashes?
It can help when the workbook contains damaged structures. Go to File > Open > Browse, select the file, click the arrow beside Open, choose Open and Repair, and select Repair.
Will copying worksheets into a new workbook remove the XML problem?
Often, yes. Right-click an unaffected sheet tab, choose Move or Copy, select (new book), and enable Create a copy. This can leave behind damaged workbook-level XML connections and metadata.




