Three file cards from a 17 October 2026 library test, each marked saved, no error raised: an Excel model losing 13 of 13 cached formula results, a Word clause collapsing 4 runs to 1 and losing a tracked change, and a slide where 2 of 4 FY25 matches changed.

When AI agents edit Excel Word PowerPoint files: what breaks and five guardrails

A file that opens is not a file that is right. We ran the same edits through the common Python libraries and their guarded forks, and the breaks we found raised no error at all.

Can AI agents edit Excel Word PowerPoint files without breaking them?#

Yes, if the pipeline refuses unclear edits, records every change as tracked, recalculates formulas and stops for a person, because the libraries underneath fail without an error. That holds for any AI (artificial intelligence) agent. In practice the risk sits in three places. First, Excel loses formula results. Then Word loses runs and revision marks, and slides hide split text. So each section below takes one failure from our 17 October 2026 test and turns it into a rule.

DiagramThe five stops between an agent's edit and a file anyone relies on. Source: Atyantik guidance, from our 17 October 2026 library test and each library's documentation.

What does a silent break cost when an agent edits a business file?#

In our 17 October 2026 library test, one input change to a 13-formula model left every result blank, so a read-back returned None where 1215.50625 belonged. But that figure was the result before the edit; after the save the file held no result. As a result, an agent that reports that cell gets nothing, or a stale copy from an earlier step. So the cost is a confident wrong answer that surfaces only when a customer finds it. Therefore the guardrails are worth one thing: a file that skipped its checks never leaves the pipeline.

In practice, production systems already work this way. In our AI purchase order entry case study, an AI service reads each order and rules match every line. Then a person checks the flags before one click sends it.

Try it
Choose a file and an edit path
File type
Edit path
After the save

Silent break

openpyxl: the projected revenue cell reads None.

0 of 13 cached formula results still held

No error, no warning about this loss.

Source: Atyantik library test, 17 October 2026, read from the saved package, not opened in Microsoft Office.

Every edit path for this file: change one input in a 13-formula model and save
Edit pathToolCountSaid so
Plain libraryopenpyxl0 of 13No
Fork, same codethe guarded fork, same code0 of 13No
Guarded APIthe guarded fork's receipt API0 of 13Yes
Pick a file and an edit path, and for Excel add a recalculation step, to see what the saved file holds and whether the tool said so. Measured in the Atyantik library test, 17 October 2026; the recalculation branch is documented, not measured.

Why does openpyxl leave Excel formulas with no results after a save?#

In our 17 October 2026 test, all 13 cached formula results disappeared after openpyxl saved one edited input, because the library stores formulas but does not calculate them. openpyxl is the common Python library for Excel files. Its tutorial says a loaded cell holds the "formula (default) or the value stored the last time Excel read the sheet". But it never holds both. That split is the whole openpyxl formula cache problem.

So after a save, the next reader sees blanks until an engine recalculates the file. In that test, the guarded fork lost the same results, but it listed each one in its save receipt.

Formula cells holding a cached value, of 13, before and after one saved input change. No library recalculates; only the receipt says so. Source: Atyantik library test, 17 October 2026.

edit pathbefore the saveafter the savereported
openpyxl130no
guarded fork, same code130no
guarded fork, receipt API130yes, each listed in the receipt

Also, features the library does not model are dropped. In the same 2026 test, openpyxl removed a sparkline with a warning, while the fork kept it.

What each library kept after one saved Excel edit. Source: Atyantik library test, 17 October 2026.

featureopenpyxlguarded fork
sparklineremoved, with a warningkept
chart, table, validation, conditional format, defined namekept, chart XML rewrittenkept, parts byte-identical
formula cached valuesall 13 removed, not reportedall 13 removed, each listed in the receipt
recalculationnonenone; adds a force-recalculate flag

Source: Atyantik library test, 17 October 2026. And each result comes from the saved package (the zip parts and the XML, or Extensible Markup Language, inside), not from opening the file in Microsoft Office.

Why do agent edits in Word lose formatting and other people's tracked changes?#

Word splits one phrase across several runs, so in our 17 October 2026 test a whole-paragraph rewrite turned 4 runs into 1, dropped the bold, and erased another reviewer's tracked change. python-docx is the usual Python library for Word files. Its text guide says a paragraph "contains one or more runs, each of which contain some part of the paragraph" text.

Because formatting lives on each run, a search that loops over runs misses a phrase split across them. Rewriting paragraph.text does find it, but it flattens the runs.

Runs in clause 4.2, before and after a paragraph.text rewrite4 runs to 1

4

Before the rewrite

1

After the rewrite

The bold on thirty went with them.

Runs in clause 4.2, before and after a paragraph.text rewrite (runs in the clause)
Optionruns in the clause
Before the rewrite4
After the rewrite1

Source: Atyantik library test, 17 October 2026, method note above

However, revisions are worse, because they live in separate markup. Microsoft's Open XML guide to revisions names the w:ins and w:del elements that hold them. In particular, in a second clause of our test, the inserted rate was not part of paragraph.text. So the rewrite deleted it and left a clause with no rate. So any plan for python-docx tracked changes has to start from the markup, not from .text.

Revision marks in the clause another reviewer changed, before and after a paragraph.text rewrite: another reviewer's change, gone with no trace. Source: Atyantik library test, 17 October 2026.

revision markbefore the rewriteafter the rewrite
tracked insertions (w:ins)10
tracked deletions (w:del)10

Why does a PowerPoint find-and-replace miss half the matches?#

A run-by-run replace in python-pptx changed 2 of 4 slide occurrences in our 17 October 2026 test, missing the one split across runs and the one inside a table cell. The cause is plain in the python-pptx text guide: "Only runs can actually contain text."

In that 2026 test, the guarded replace reached all 4 and kept the formatting. However, even it left the chart series name and the speaker notes untouched. So a replace must report what it changed and also what it could not reach.

Show data table
Slide occurrences of the label FY25 changed, of 4, on three edit paths. Source: Atyantik library test, 17 October 2026.
Item Value
python-pptx run loop 2 of 4
guarded fork, same code 2 of 4
guarded fork replace_text 4 of 4

Changing the package alone changed nothing; the new call did.

Slide occurrences of FY25 changed, of 4 Slide occurrences of the label FY25 changed, of 4, on three edit paths. Source: Atyantik library test, 17 October 2026. Atyantik library test, 17 October 2026

Which five guardrails does a production edit pipeline need?#

Five guardrails hold whichever tool edits the file: refuse an unclear target, write tracked changes, return a receipt, recalculate before reading results, and stop for a person.

  1. Refuse instead of guess. In our 17 October 2026 test, the guarded Word API (application programming interface) refused three edits. One overlapped a pending tracked insertion, one had a target that existed only as deleted text, and one had 6 matches. After that, the source file was byte-identical.
  2. Edit as tracked changes. The same API wrote the split phrase as a tracked deletion and insertion, and it kept the bold.
  3. Return a receipt. The paper-pptx README says its call "returns a machine-readable result and refuses unsupported edits". So any tool you pick should hand back that kind of record.
  4. Recalculate before reading. The SpreadsheetBench README runs a step that "forces formula recalculation so that cached cell values are available to openpyxl" before it scores.
  5. Stop for a person. Microsoft's support page says Copilot in Excel has a plan mode, so you can "review and confirm the approach before starting".

Four Word edits, python-docx against the guarded fork API. Source: Atyantik library test, 17 October 2026.

editpython-docxguarded fork API
phrase split across 4 runsrun loop misses it; rewrite collapses 4 runs to 1, bold lost, untrackedtracked deletion and insertion, bold kept
rewrite a clause holding another reviewer's tracked changethe tracked insertion is deleted with no tracerefused: overlaps a pending tracked insertion
target exists only as deleted textnot applicablerefused: target not found
ambiguous target, 6 matchesnot applicablerefused, locations listed

Source: Atyantik library test, 17 October 2026.

Which documentation should an edit pipeline be built from?#

Build from the official pages in this order: openpyxl's loading options, the python-docx and python-pptx text models, then LibreOffice's headless start parameters for recalculation.

  1. openpyxl tutorial

    openpyxl tutorial: load_workbook and its data_only flag.

  2. python-docx text guide

    python-docx text guide: paragraphs, runs, and where formatting lives.

  3. python-pptx text guide

    python-pptx text guide: text frames, paragraphs and runs on a slide.

  4. LibreOffice start parameters

    LibreOffice start parameters: --headless and --convert-to, which run the free office suite with no screen.

  5. paper-xlsx README

    paper-xlsx README: one example of a save receipt.

The five pages, in order: openpyxl tutorial, python-docx text guide, python-pptx text guide, LibreOffice start parameters, paper-xlsx README.

What is the smallest Excel edit that cannot report a stale number?#

Write the input with openpyxl, recalculate the saved file with headless LibreOffice, then reload with data_only and refuse to report while any formula cell still reads None.

python
import subprocess
from openpyxl import load_workbook

wb = load_workbook("model.xlsx")
ws = wb.active
ws["B1"] = 0.07
formulas = [c.coordinate for row in ws.iter_rows() for c in row
            if isinstance(c.value, str) and c.value.startswith("=")]
wb.save("model-edited.xlsx")

subprocess.run(["soffice", "--headless", "--convert-to", "xlsx",
                "--outdir", "recalculated", "model-edited.xlsx"], check=True)

values = load_workbook("recalculated/model-edited.xlsx", data_only=True).active
empty = [ref for ref in formulas if values[ref].value is None]
if empty:
    raise RuntimeError(f"no calculated value in {empty}; do not report")

So the last two lines are the guardrail. If the conversion did not recalculate, the check refuses instead of passing a blank on. But our test machine had no LibreOffice, so this step comes from the documentation, not from our run.

Should you build on Python libraries or buy a desktop or SaaS agent?#

An in-app agent edits through the application itself, so Excel still does the calculating, while a library pipeline runs headless inside your systems and leaves every guardrail to you.

For instance, Microsoft's support page says "Copilot updates your workbook using Excel's built-in features". Its limitations page adds that editing needs Calculation Options set to Automatic. Also, it says to "Review, edit, and verify anything Copilot creates before you rely on it." In short, an in-app agent suits files people already open in Excel, one at a time.

Meanwhile, a library pipeline suits files that arrive in bulk from email or another system. SaaS (software as a service) tools sit between the two. But a library's costs are real: no calculation engine, and every guardrail is yours to build. On 17 October 2026, the guarded forks we tested were at version 0.2 and two to three months old. And other tools exist beyond the ones named here.

For example, test any candidate the way SpreadsheetBench, a public benchmark of spreadsheet tasks, tests models: many files per instruction, recalculated before scoring.

Show data table
912 instructions, 2,729 test cases and a 400-instance Verified subset, as the SpreadsheetBench README counts them (updated December 2025). Source: SpreadsheetBench README, RUCKBReasoning.
Item Value
instructions 912 items
test cases 2,729 items
Verified subset instances 400 items

Several test cases per instruction, because one file proves little.

SpreadsheetBench scale 912 instructions, 2,729 test cases and a 400-instance Verified subset, as the SpreadsheetBench README counts them (updated December 2025). Source: SpreadsheetBench README, RUCKBReasoning. SpreadsheetBench README, RUCKBReasoning, December 2025

After that, run our three edits on your own files. First, change an input and read a result back. Then rewrite a clause that holds a tracked change, and replace a label that sits in a table.

When is an AI agent the wrong tool for editing an Office file?#

An agent is the wrong tool when the file can be regenerated from data, when a person can make the edit faster, or when nobody will review the result. If a monthly report comes from one template, fill it from data instead. When one clause changes, a person in Word is faster. Finally, with no reviewer assigned, use the application's own agent and its change history, or skip the automation.

DiagramThree questions before an agent edits the file, and the better tool at each. Source: Atyantik guidance; change history per Microsoft's Copilot in Excel support page, accessed 17 October 2026.

Where does this pattern show up in other AI agent work?#

The same refuse, track, check and review pattern runs through purchase order automation, AI code review and agent governance, and each has its own write-up below. First, see how AI purchase order entry for business-to-business sellers is decided. Then read how to trust AI-generated code before it ships. Also see where checkpoints sit in an agentic software development lifecycle. If you are building your own, see AI agent development and API integrations. Still, the library docs above are enough to build the check yourself.

Questions this post answers

Can AI agents edit Excel Word PowerPoint files without breaking them?
Yes, if the pipeline refuses unclear edits, records every change as tracked, recalculates formulas and stops for a person, because the libraries underneath fail without an error. That holds for any AI (artificial intelligence) agent.
Why does openpyxl leave Excel formulas with no results after a save?
In our 17 October 2026 test, all 13 cached formula results disappeared after openpyxl saved one edited input, because the library stores formulas but does not calculate them. So after a save, the next reader sees blanks until an engine recalculates the file.
When is an AI agent the wrong tool for editing an Office file?
An agent is the wrong tool when the file can be regenerated from data, when a person can make the edit faster, or when nobody will review the result. If a monthly report comes from one template, fill it from data instead.

Keep reading