u/Sea-Supermarket6441

▲ 3 r/excel

Can I trust calcCompleted in workbook.xml to tell me cached formula results are stale?

Mac Excel 16.113.3 (365), macOS 26.5

I read .xlsx files with a script (ExcelJS 4.4, Node), so I only ever see whatever result Excel cached at save time. Trying to figure out if the file can tell me when that cache is lying.

Tiny repro:

  1. A1 = 10, B1 = =A1*2 → 20

  2. Calc set to Manual, "Recalculate workbook before saving" unchecked

  3. A1 → 15, save

Excel shows B1 as 20 with a strikethrough (Format Stale Values), so Excel clearly knows. The file still stores 20, and my script happily reads 20.

What's in xl/workbook.xml:
<calcPr calcId="181029" calcMode="manual" calcCompleted="0" calcOnSave="0"/>
and B1 is saved as <f ca="1">A1*2</f>

So calcCompleted="0" looks like the flag I want. Before I build a warning on it:

  1. does Excel ever write calcCompleted="0" when the values are actually fine?

  2. if it's missing or "1", can the cached values still be stale?

  3. what do non-Excel files do (LibreOffice, Google Sheets downloads, openpyxl)? Do they write calcPr at all?

ExcelJS doesn't give me calcPr, so I'll parse workbook.xml myself. That part's easy. I just don't want to build on a flag that only works half the time.

Disclosure: this is for a tool I'm building (Pactbeam). No link, just want to get this bit right.

reddit.com
u/Sea-Supermarket6441 — 8 days ago