跳转到主要内容

WRITING

Moving the AI Into Excel: A Workflow Migration Forced by 'Regenerate'

August 5, 20267 min readTianli Zeng
ai-collaborationexcelworkflowwater-engineering
Moving the AI Into Excel: A Workflow Migration Forced by 'Regenerate'

I spent an afternoon tuning charts in Excel. One "regenerate" from the AI wiped them all — and it made the same mistake twice.

For the past few months I had an AI generate my hydraulic-engineering workbooks with scripts on my computer. It was genuinely efficient. But the moment I started editing the finished product myself, the whole setup turned against my own work. This post is about how I swapped "the AI generates files from outside" for "the AI moves into Excel and edits in place" — and about the hardest thing to move: the rules.

1. How the Script Era Collapsed

Some background. An ecological-flow calculation for a river in Shaoxing lived in one workbook: a dozen sheets of live formulas, eight charts. The AI generated the whole file with a script on my machine — change one parameter, everything recalculates, every chart redraws. That stage felt great.

Then it collapsed. I opened Excel and hand-tuned the charts: axis ranges, colors, positions. Saved. To me, that was now the final version. Next time I asked the AI to change something else, it did what it always did — regenerated the entire file. Everything I had tuned was gone. The first time I called it an accident. The second time I laid down a rule: "From now on, whatever I edit by hand is the final version. If you want changes, make them on my version."

Worse, the common spreadsheet-processing libraries can't even do "read it in, write it back unchanged" — one read-and-save quietly drops hand-inserted charts. So even a script that only wants to touch one cell can damage the whole file it passes through.

Diagram comparing script regeneration from outside versus in-place AI edits
Same change request, two completely different endings: the left path crushes my hand edits on every run; the right path touches only the cells that need to change.

The root cause in one sentence: the script treats the file as a build artifact that can be recreated at any time; I treat the file as a manuscript someone is actively editing. Once a human starts working on the finished product, those two worldviews collide — and the human loses every time.

2. Moving the AI Into Excel — Where It's Blind

The fix wasn't making the scripts more careful. It was changing venues. Claude now ships an official Excel add-in: the AI sits in a sidebar inside the spreadsheet, editing the very file I have open, in place, incrementally. "Protect my final version" went from a discipline I had to keep repeating to a physical default — the add-in simply has no "regenerate the whole file" move.

But once inside, two hard limits surface. First, it cannot see any file on my computer: project documents, parameter provenance, previously settled results — all out of reach. Second, it has no memory across conversations: whatever we align on today is gone, word for word, the next time I open the sidebar.

So the real work wasn't "install an add-in." It was repackaging two years of rules — accumulated in scripts, checkers, and project notes — and delivering them through the three channels the platform actually offers:

ChannelWhen it appliesWhat belongs there
Sidebar instructionsEvery conversation; edits take effect immediatelyHard rules you can state in a sentence or two
Skill packagesLoaded only when trigger words match; changes require re-uploadLong content with context and version history
A parameters sheet inside the workbookTravels with the file, even to colleaguesThe parameter table (made on demand)
Diagram of the three configuration channels and when each takes effect
The three channels: sidebar instructions are always present, skill packages load on topic match, an embedded parameters sheet travels with the file. Put a rule in the wrong place and it may as well not exist.

3. Two Layers of Packaging: One Generic, One Per Project

I split the rules into two packages. The generic package holds discipline that applies to any workbook: every number carries value, unit, time basis, and source; never invent a number that lacks provenance; anything I've hand-edited is final; charts live on the same sheet as the data they plot. The project package holds only this project's settled facts: roughness 0.030, slope 0.0003, frequency 90%, each with its source; which files are a colleague's originals that must never be touched; settled results that get cited, not recomputed.

Why not one package? Generic rules copied into every project package drift apart the moment one copy changes. Project parameters pushed into the generic layer leak into unrelated workbooks. Two layers, each with its own job; when they conflict, the project package wins.

Diagram of the generic-discipline package and project-parameters package routing
An ordinary workbook only triggers the generic package; mention the project keywords and both load, with the project package taking precedence.

The most valuable part of the packages is the incident log — every entry a mistake that actually happened, not a hypothetical:

IncidentIn one line
Frozen panesI said no; it kept adding them as a "good habit" — we ended up scrubbing 26 of them
Invisible fake pointsFormula blanks plotted as zeros; the trend line's goodness of fit fell from 0.94 to 0.10
Name collisionA formula name shaped like a cell address; Excel gave no error and the workbook quietly collapsed into division-by-zero
Formula overloadTwo thousand averaging formulas in one sheet froze the file on open — cells that never vary should hold plain values
Chart showing how blanks plotted as zeros drag the trend line off the data
The same data, before and after fake zero-points sneak in: the fit goes from hugging the data to complete distortion — the kind of error only eyes on the chart can catch.

4. It Has No Memory, but the Process Can

The missing memory is patched with an external loop. When it makes a mistake in Excel, or we align on a new rule, I say "write it down" — and it outputs exactly three lines: what went wrong, why it went wrong, what to do next time. Back on my computer: rules that fit in a sentence get pasted into the sidebar instructions and apply immediately; rules that need context get inserted into a skill package by a single command, repackaged, and re-uploaded once.

Every incident in the table above entered the packages through this loop. Once it's running, the packages get sharper with use — the AI can't remember, but every mistake becomes a rule that's already loaded when the next conversation starts.

Diagram of the loop from mistake to three-line summary to packaged rule
The external memory loop: mistake → three-line summary → into instructions or a skill package → automatically present next conversation. The AI has no memory; the process does.

The boundary matters too: not every job belongs in the add-in. Cross-workbook aggregation, client-facing deliverable tables, database backfills — those still run through the deterministic pipeline on my computer. The add-in handles only the file that's open, and when in doubt, its standing instruction is "point it out, don't touch it."

Looking back, what this migration actually moved wasn't the tool — it was the rules. Not one lesson from the script era was wasted; they all carried over to a new home and kept working. Tools will keep changing. The AI has no memory, but the process can.