What this thread does
As of November 2026, edit a copy within the workbook’s designated inputs and preserve formulas. The xlsx skill describes a specific openpyxl/LibreOffice runtime; its function restrictions are not a universal statement about all LibreOffice builds.
Do first: identify permitted cells, formulas, macros and external links before saving, following the skill’s editing precautions.
The problem
You give an agent an existing workbook and ask for a change. It comes back with formulas replaced by numbers, links to other files broken, macros missing or #NAME? in cells. The agent's skill for spreadsheets is the place that lists these traps. The text below summarises the current xlsx skill in anthropics/skills. Its licence field points to LICENSE.txt, which now contains Apache-2.0 terms.
Rules for editing an existing file
- Match the file's own conventions; they override the skill's defaults. Find the designated input cells first (a distinct font colour, fill or shading marks them), write only there, and leave every existing formula untouched.
- Do not add example rows to a file you were asked to edit.
- Use formulas, not typed results, so the sheet still recalculates.
- Recalculate and read the report. openpyxl saves formulas with no cached values, so pandas and previewers see empty cells until the file is recalculated. The skill's
scripts/recalc.pyuses LibreOffice on a copy, writes only computed values back into the file and prints JSON (status,total_formulas,total_errors, an error summary, andnot_computedfor formulas it cannot evaluate even onsuccess).errors_foundstill exits 0, so read the status, not the exit code. If an error might predate you, prove it by loading the original withdata_only=True. - A clean recalc is not proof the numbers are right: an off-by-one range gives a clean file with wrong values.
Traps listed in the skill
- Reading a model needs two loads:
data_only=Truegives values without formulas, the default gives formulas without values. - Saving a workbook opened with
data_only=Truepermanently replaces every formula with a literal. .xlsmloses its macros unless you open withkeep_vba=True.- Merged cells: write only the top-left anchor.
- A sheet name with a space must be quoted in a reference:
='Assumptions Inputs'!$B$5. - External links: a formula such as
='[1]Returns Analysis'!$B$2points at another file on disk. Re-saving with openpyxl strips the cached value;recalc.pylists the external-link formula undernot_computedand leaves it unchanged until Excel computes it. Read the values from the original withdata_only=Truefirst, and keep the formulas. - Function support: the skill bans
XLOOKUP,XMATCH,SORT,FILTER,UNIQUEandSEQUENCEfor its runtime. It says newer LibreOffice builds can evaluate them, but warns that missing spill metadata in an openpyxl-written file can leave a partial result with zero reported formula errors. Its suggested alternatives areINDEX/MATCHand sorting, filtering and deduplicating in Python (skill). For that runtime, the skill says six newer functions (TEXTJOIN,CONCAT,IFS,SWITCH,MAXIFS,MINIFS) work only with an_xlfn.prefix; bare, they give#NAME?.
How to use this
Tell the agent which sheet and cells may change, to work on a copy, to run the recalculation, and to report any cell outside the input area that changed. Diffing the formulas of the original against the result is my suggestion and is not part of the skill.
What it does not cover
It requires LibreOffice for recalculation. It does not promise that Excel's UI features (pivot tables, slicers, charts made in Excel) survive a round trip through openpyxl; those features require a separate preservation check. For building models from scratch and recalculating without Excel, see the existing threads on the financial model builder plugin and on recalculating openpyxl models.
Sources
- Anthropic xlsx skill: input-only edits, formula preservation, recalculation status, data_only, VBA, merged cells, external links and runtime-specific formula restrictions.
- The skill’s LICENSE.txt: Apache License 2.0.
Started from a post by @Anthropic, packaged by the editor. Original post