sharedStrings-v1.xml, sharedStrings-v2.xml) so you can step back to any point.
What a Healthy sharedStrings.xml Looks Like
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sst xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
count="22" uniqueCount="18">
<si><t>Product</t></si> <!-- index 0 -->
<si><t>Region</t></si> <!-- index 1 -->
<si><t>Q1 Revenue</t></si> <!-- index 2 -->
<si><t>Widget A</t></si> <!-- index 3 -->
<!-- ... -->
</sst>
count = total number of string references across the whole workbook (the same string in 10 cells counts 10 times).
uniqueCount = number of actual <si> entries in this file.
count / uniqueCount Mismatch
The count and uniqueCount attributes on <sst> must accurately reflect the file's contents. When they don't, Excel will repair and may discard string data it cannot reconcile.
Repaired Records: String properties from /xl/sharedStrings.xml part
<!-- CORRUPT: count says 999 but only 4 entries exist -->
<sst count="999" uniqueCount="999"> <!-- ← wrong values -->
<si><t>Product</t></si>
<si><t>Region</t></si>
<si><t>Widget A</t></si>
<si><t>Widget B</t></si>
</sst>
Fix: Count the actual <si> entries and update uniqueCount to match. For count, setting it equal to uniqueCount is safe — Excel recalculates the true value on next save.
<!-- Fixed -->
<sst count="4" uniqueCount="4">
<si><t>Product</t></si>
<si><t>Region</t></si>
<si><t>Widget A</t></si>
<si><t>Widget B</t></si>
</sst>
Truncated File: Mid-Save Crash
The most common result of a crash during save. The file ends in the middle of a string entry, leaving unclosed tags.
Removed Part: /xl/sharedStrings.xml part with XML error. (Strings)
Unexpected end of input. Line 12, Column 18.
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<sst count="18" uniqueCount="18">
<si><t>Product</t></si>
<si><t>Region</t></si>
<si><t>Widget A</t></si>
<si><t>Widget B</t></si>
<si><t>Widget C</t></si>
<si><t>Widget D</t></si>
<si><t>Widget <!-- ← CORRUPT: file ends here, mid-word -->
Fix, Option 1: If you can reconstruct the missing strings from the data, add them back and close all open tags.
Fix, Option 2: Delete all incomplete <si> entries, close the </sst> tag, and update count and uniqueCount to reflect only the complete entries. You'll lose values in cells that referenced the deleted entries, but the file will open.
<!-- Fixed with Option 2 — keeping only complete entries -->
<sst count="8" uniqueCount="8">
<si><t>Product</t></si>
<si><t>Region</t></si>
<si><t>Widget A</t></si>
<si><t>Widget B</t></si>
<si><t>Widget C</t></si>
<si><t>Widget D</t></si>
<si><t>Widget E</t></si>
<si><t>Widget F</t></si>
</sst>
Unescaped Special Characters
XML requires that certain characters inside tag content be escaped. The most common offenders are &, <, and >. When they appear unescaped, the XML parser cannot tell where a tag ends.
Removed Part: /xl/sharedStrings.xml part with XML error. (Strings)
<!-- CORRUPT: unescaped & and > -->
<si><t>Revenue > Costs</t></si> <!-- ← > must be > -->
<si><t>Price & Volume</t></si> <!-- ← & must be & -->
<!-- Fixed -->
<si><t>Revenue > Costs</t></si>
<si><t>Price & Volume</t></si>
Full escape reference:
| Character | Escaped form |
|---|---|
& | & |
< | < |
> | > |
" | " |
' | ' |
Checklist: How to Check sharedStrings.xml in Your File
- Rename your XLSX to .zip, navigate to the
xlfolder, copysharedStrings.xmlto your Desktop - Open in VS Code (with the Red Hat XML extension) and press Shift+Alt+F to format
- Check the
countanduniqueCounton the opening<sst>line - Scroll to the very end of the file — the last two lines should be
</si>then</sst> - If VS Code shows red underlines anywhere, you have found the corruption
- Use Ctrl+G to jump to a specific line if the Excel error message gave you a line number