How to Repair Corrupted Drawing XML in Macro-Enabled Excel Workbooks
Question details
The user needs to repair a macro-enabled workbook that fails to load due to a corrupted drawing XML file, while ensuring that extensive VBA code and intricate drawings are not lost during the process.

- Product
- Excel
- Device & OS
- not provided
- Scenario
- Opening a heavily customized macro-enabled workbook (.xlsm) that contains multiple drawings, charts, and extensive VBA code.
- Observed behavior
- Excel forces a repair operation, reporting a specific problem in the xl/drawings/drawing1.xml part, and standard copy-and-paste data recovery methods are impractical due to the file's complexity.
Before attempting any file repairs, make a secure backup copy of your corrupted macro-enabled workbook to ensure your VBA code is not permanently stripped out by Excel's automated recovery processes.
Use the Excel Repair Log to Isolate Damaged Objects
Utilize the built-in repair log generated by Excel to identify the specific corrupted worksheet, allowing you to selectively remove and replace broken shapes.
Excel's automatic repair tool often generates an XML log file that points directly to the worksheet containing the corrupted drawing elements. By identifying this object, you can fix the issue in a backup copy without having to rebuild the entire complex workbook from scratch.
Open the corrupted workbook in Excel. When prompted that the file contains unreadable content, click 'Yes' to allow Excel to attempt a repair.
Once the repair process finishes, click the linked text in the dialog box to view the detailed repair log file.
Read the log text to identify which specific worksheet and shape, chart, or connector triggered the drawing1.xml error.
Open your unaffected backup copy of the workbook, navigate to the identified worksheet, and manually delete the suspicious drawings or charts.
Save the backup file, close it, and reopen it to ensure the XML error is resolved. Once confirmed, you can safely recreate the deleted shapes.

Extract and Rebuild the VBA Project
If you cannot identify the specific damaged drawing, extract your VBA project modules and import them into a fresh workbook with recovered data.
Try WPS Office for Enhanced File Stability
Complex drawing XML errors are often deeply tied to specific quirks in Microsoft Excel's rendering engine. If you frequently handle heavy macro-enabled workbooks and encounter file corruption, consider switching to WPS Office. It provides a highly stable, lightweight environment that gracefully manages complex spreadsheet components.

Frequently Asked Questions
What exactly causes the drawing1.xml error in Excel?
This error typically occurs when the background XML code defining shapes, text boxes, charts, or images in your spreadsheet becomes corrupted. This can be caused by software crashes, abrupt shutdowns, or saving files over unstable network connections.
Will Excel's automatic repair delete my VBA macros?
Excel's automatic repair attempts to salvage as much data as possible, but severe XML corruption can sometimes cause the recovery tool to strip out unreadable elements, which may include your VBA modules. This is why you should always repair a copy, not the original.
Can I manually inspect the drawing.xml file to fix the code?
Yes. Because .xlsm files are essentially zipped archives, you can change the file extension from .xlsm to .zip, extract the contents, and navigate to the 'xl/drawings' folder. You can then open the XML files in a text editor to identify or remove corrupted syntax strings, though this requires advanced knowledge of XML structures.




