What You Need

  • Windows Explorer — built in, no install needed
  • A text editor: Notepad works for small edits; VS Code or Notepad++ are much better as they show XML in a readable indented form. VS Code also requires the XML extension by Red Hat (free, in the Extensions marketplace) to enable formatting and validation.
  • A copy of your XLSX or XLSM file to practice on
Before you start: copy your file and verify the original Make a copy of your file and work on the copy — never edit your only version. Before touching anything, also confirm that the original file still opens in Excel (or fails in a predictable way). This gives you a clean baseline to compare against and something to fall back on if an edit makes things worse. As you make edits, save incremental copies of each XML file you change (sharedStrings-v1.xml, sharedStrings-v2.xml) so you can step back to any point.

Step 1: Rename the File Extension to .zip

Open Windows Explorer and navigate to your file. If you don't see the .xlsx extension in the filename, turn that on first.

To show file extensions: Go to View in the Explorer toolbar, then check File name extensions.

Windows Explorer View menu with File name extensions checkbox highlighted

Right-click your XLSX file and choose Rename. Change .xlsx to .zip and press Enter. Windows will warn you the file may become unusable — click Yes.

Right-click Rename dialog changing .xlsx to .zip in Windows Explorer

The file icon changes to a folder-with-zipper. The file itself has not changed at all — you only changed the label.

The file now showing the ZIP archive icon with folder-and-zipper graphic

Step 2: Open the ZIP and Navigate the Contents

Double-click the ZIP file. Windows Explorer opens it like a folder showing the internal structure.

ZIP file opened in Windows Explorer showing [Content_Types].xml, _rels, docProps, and xl folders

The important files are inside the xl folder. Double-click xl to go deeper. You'll see workbook.xml, sharedStrings.xml, styles.xml, and a worksheets folder containing sheet1.xml.

Contents of the xl folder: workbook.xml, sharedStrings.xml, styles.xml, worksheets/ and theme/
Don't extract yet Just browse at this stage. Extracting everything and re-zipping is where most people create a broken file — see the Nested Folder Problem section below.

Step 3: Extract Only the File You Want to Edit

Find the specific XML file you need to change. Right-click it and choose Copy, then paste it somewhere easy to find — your Desktop works well.

Right-clicking an XML file inside the open ZIP and choosing Copy

Open the copied file in your text editor. Make your changes and save.

The XML file open in VS Code showing readable formatted XML structure
If the XML shows as one unreadable line Look for a Format Document or Prettify option. In VS Code press Shift+Alt+F. In Notepad++ use Plugins > XML Tools > Pretty Print. This adds whitespace only — it does not change the file's content.

Step 4: Put the Edited File Back

Go back to your ZIP file in Explorer. Navigate to the folder where the original XML file lives. Drag or paste your edited file into that location inside the ZIP. Windows will ask if you want to replace the existing file — click Yes.

Dragging the edited XML file back into the xl folder inside the open ZIP, with Replace confirmation dialog

Step 5: Rename Back to .xlsx

Right-click the ZIP file and choose Rename. Change .zip back to .xlsx. Click Yes at the warning.

Renaming the ZIP file back to .xlsx extension

Open the file in Excel and verify it works cleanly.

Excel opening the repaired file with no error or repair prompt

The Nested Folder Problem: Read This

This is where most people break their file. Here is what happens.

Some guides tell you to extract the entire ZIP, make your edits, then select all the files, right-click and choose Send to > Compressed folder. If you do this from inside the extracted folder, Windows creates a ZIP that looks like this:

YourFile.zip
  └── YourFile/          ← extra folder wrapper
        ├── [Content_Types].xml
        ├── _rels/
        └── xl/

When you rename that back to .xlsx, Excel sees the extra folder layer and rejects the file — the format requires files to sit at the root of the ZIP with no wrapper.

The correct structure is:

YourFile.zip
  ├── [Content_Types].xml
  ├── _rels/
  └── xl/
Side-by-side: wrong ZIP structure with extra folder wrapper vs correct flat structure at root
Left: the broken nested-folder structure Excel rejects. Right: the correct flat structure Excel expects.
The safest rule Always use the copy-out / paste-back method from Steps 3 and 4. Copy the individual XML file out, edit it, and paste it back into the open ZIP. Never extract and re-zip the whole archive unless you must.

If you do need to re-zip from scratch (for example after adding a new file), use 7-Zip (free). Right-click inside the extracted folder contents — not the folder itself — and add to archive. Or use the command line:

cd "C:\path\to\extracted\contents"
7z a -tzip ..\MyFile.xlsx *

The * selects everything inside the current folder rather than the folder itself, producing the correct flat structure.


Verification Step

After renaming back to .xlsx, open the file in Excel.

  • Opens cleanly with no prompt — you're done.
  • Excel says "We found a problem with some content" — your XML edit introduced an error. Click Yes to let Excel repair it, then check the recovery log to understand what was removed.
Excel dialog: We found a problem with some content — do you want us to recover as much as we can?

The recovery log is saved in C:\Users\[YourName]\AppData\Local\Temp\ and named something like error086040_01.xml. Open it in a browser to read what was removed — the line numbers it reports are your starting point for finding the error in your XML edit.

Excel repair log XML file open in a browser showing removed parts with part names and descriptions
Open the XML in VS Code before re-zipping VS Code flags malformed XML with red underlines as you type, so you can catch errors before they reach Excel. A clean VS Code means a clean file.