Use case

Why charts and pivot tables disappear when you edit someone else's workbook

What is actually inside an .xlsx file, why a save in the wrong app strips charts, pivot caches and conditional formatting, and how to check whether your own workflow does it.

You get a workbook, you fix two numbers, you send it back, and the reply is that the charts are gone. Nothing you did removed them. The save did, because most spreadsheet applications do not edit an .xlsx file so much as rebuild it from whatever they understood when they opened it.

What is actually inside the file

An .xlsx file is a ZIP archive of XML parts. Rename one to .zip and unzip it and you will see something close to this:

[Content_Types].xml
_rels/.rels
xl/workbook.xml
xl/_rels/workbook.xml.rels
xl/worksheets/sheet1.xml
xl/worksheets/sheet2.xml
xl/sharedStrings.xml
xl/styles.xml
xl/theme/theme1.xml
xl/charts/chart1.xml
xl/drawings/drawing1.xml
xl/pivotCache/pivotCacheDefinition1.xml
xl/tables/table1.xml
docProps/app.xml

The cells you edit live in xl/worksheets/sheetN.xml. Everything else is context: the theme that decides what "accent 1" looks like, the chart definitions, the pivot cache that holds a snapshot of the source data, the table definitions that make a range behave like a table, the printer settings. None of that is data you typed, and all of it is data someone will notice missing.

Why a save loses it

When an application opens a workbook, it parses the parts it models into an in-memory representation: sheets, rows, cells, styles. Parts it does not model are, from its point of view, not there. On save it serialises its model back out to a fresh ZIP. The output contains exactly what the model held, which is why the chart part is missing: nothing in the model ever represented it.

This is not a bug anyone forgot to fix. It is the natural consequence of a model-and-serialise design, and it is why the same file can survive one application and not another. Applications also differ in the smaller direction: a round trip may keep the chart but lose a column width, a defined name, or the exact number format on one cell.

Two save strategies
Model-and-serialiseRewrite only what changed
Parts writtenAll of them, from the modelOnly the parts the editor models
Parts not modelledDroppedCopied through byte for byte
RiskSilent loss of charts, pivot caches, drawings, conditional formattingThe editor must be honest about what it does not display

The approach Native Sheets takes

Native Sheets keeps the raw bytes of every part it opened. On save it regenerates only workbook.xml, the sheet parts, sharedStrings.xml, [Content_Types].xml and the workbook relationships, then copies everything else straight through. Themes, tables, pivot caches, charts, drawings and conditional formatting come back out byte for byte. The mechanics are described here.

The honest limitation

Preserved is not the same as editable. Native Sheets does not display or edit charts, images, pivot tables or conditional formatting. It carries them; it does not show them. If you need to change a chart, you need an application that models charts.

On the project's sample workbook, a 1.6 MB four-sheet tracker with 20,739 cells and 4,530 formulas, an open-and-save round trip left all 20,739 cells identical, and the result was cross-checked with openpyxl, an unrelated implementation, which reported no differences in values, styles, tables, column widths or frozen panes.

Checking your own workflow

You do not have to take anyone's word for which of your tools drops things. Compare the part listing before and after a save:

  1. cp book.xlsx before.xlsx to keep an untouched copy.
  2. Open the workbook in the application you are testing, change one cell, save.
  3. List the parts in each file with unzip -l before.xlsx and unzip -l book.xlsx, then compare the two listings.
  4. Anything that appears in the first listing and not the second was dropped by that save.
unzip -l before.xlsx | awk '{print $4}' | sort > /tmp/before.txt
unzip -l book.xlsx   | awk '{print $4}' | sort > /tmp/after.txt
diff /tmp/before.txt /tmp/after.txt

A missing xl/charts/ or xl/pivotCache/ line is your answer. Note that identical part names do not prove identical contents, so this checks for loss, not for fidelity. If you want to see which sheets and values survived, open both files in the browser viewer and compare them side by side.

Open a workbook in the browser