Using Claude Cowork with Excel

I’ve used Claude Cowork to automate updating of several financial workbooks and learned a lot about things you have to be careful of. Here’s my outline.

  • Cowork does not actually operate in the Excel application. It saves a copy of your workbook and uses openpyxl and PYTHON to make changes via XML. Openpyxl operates on the saved XML state of the workbook — it has no knowledge of anything Excel computes, renders, or manages dynamically. Anything in your workbook that is dynamic (calculated, refreshed, structured, or rendered by Excel at runtime) is invisible to Cowork or potentially at risk.
  • Some specific areas to be aware of:
    • Formulas with ranges. When you use Excel, changing the value in a cell will result in automatic changes to cells that refer to it. Not true with Cowork. In most cases, this is not a problem but be careful – it can be.
    • Insertions. When you use Excel, inserting rows or columns will automatically change ranges in other cells that refer to those rows and columns. Cowork will not. if Cowork inserts or deletes rows/columns, named ranges that were defined by absolute addresses may now point to wrong cells. Openpyxl won’t adjust them. You must specifically instruct Cowork to locate and change any such affected ranges.
    • XLSX vs XLSM. If your workbook has macros, be careful to tell Cowork – it can corrupt a file it saves if it doesn’t account for its being an xlsx vs. xlsm. Always confirm the output filename extension matches the input — .xlsm in, .xlsm out.
    • Macros will not run when Cowork is updating a workbook because Cowork is not using Excel. This may or may not be a problem, but it’s important to know. Any macro-dependent state must be established before handing the file to Cowork.
    • Formula dependencies. Any formula depending on external data connections, named ranges, or structured table references can break. You must explicitly tell Cowork about any such formulas that you want properly retained and updated.
    • Formatting. When replacing data in a worksheet, Cowork simply writes values and leaves prior formatting in place. This can leave improper cell backgrounds or result in Excel interpreting numbers as dates. In your documentation, you must explicitly tell Cowork to clear all formatting as well as data before writing new data.
    • Array formulas (ctrl-shift-enter) – openpyxl does not handle these consistently. They may be read or written incorrectly.
    • Dynamic arrays. (SPILL ranges — SORT, FILTER, UNIQUE, XLOOKUP returning arrays) — openpyxl has no awareness of spill ranges. It sees only the anchor cell. If Cowork writes into a spill range’s territory, it will cause a #SPILL error with no warning.
    • Excel Tables (ListObjects — the formatted blue/green banded tables) — openpyxl can read cell values within them but doesn’t understand Table structure. It won’t extend the Table boundary if you add rows, and it may break structured references like =Table1[Amount].
    • Power Query — openpyxl is completely unaware of it. If a sheet is populated by Power Query, Cowork sees only the last-refreshed snapshot. If Cowork writes into a Power Query output sheet, the next refresh will overwrite its work silently.
    • Pivot Tables — similar: openpyxl sees only the cached data, not the Pivot structure. Writing into a Pivot Table’s range is risky and should simply be avoided.
    • Charts — openpyxl can corrupt chart objects if it writes into their source data range unexpectedly. The chart may lose its series definitions with no warning.
    • Conditional formatting — openpyxl may not preserve complex conditional formatting rules, especially formula-based ones. Verify visually after any Cowork update.
    • Data validation (dropdown lists, input constraints) — openpyxl may strip or corrupt validation rules on cells it writes to.
    • Merged cells — openpyxl handles these imperfectly. Writing into a merged range can silently unmerge it. Flag any merged cells explicitly.
    • Volatile functions (TODAY(), NOW(), RAND(), OFFSET()) — openpyxl won’t recalculate them. Whatever value was cached when Excel last saved is what Cowork sees and preserves. If your workbook uses TODAY() for date comparisons, the result Cowork reads may be stale.
  • It is imperative that you start out by writing a detailed description of your file(s) and process. Explain the purpose of each worksheet. It really does help if Cowork knows what you’re trying to accomplish. Treat it like someone who doesn’t know Excel – explain everything. Be sure to point out any dynamic elements and Excel tables in your workbook.
  • Save a backup of the pre-Cowork file until processing and verification are complete.
  • Always verify after Cowork processes a workbook. Open it in Excel and check: (a) calculated cells show expected values, (b) any formatted ranges look correct, (c) named ranges and structured references still resolve properly, and (d) any dynamic elements you flagged in your documentation behave as expected.
3 Likes

One of the things I failed to mention is STOCK PRICES. Stock prices in Excel do not use an add-in, but they are an external data connection and therefore do not update with changes by Claude CoWork. Worse, if CCW over-writes one of those cells with new data, it will break the connection. As an example, I update my portfolio in excel monthly with positions downloads from Schwab, which CCW now does for me. In the event that a new stock symbol shows up in my positions download, it creates two of the above problems: 1) if CCW inserts new row(s), it breaks all subsequent row references; 2) it breaks all the stock lookups. The solution is simple, but illustrates the importance of testing and good instructions: if CCW finds any new stock symbols, it STOPS, tells me what the symbols are and where they need to be inserted. I open the file, insert the new rows (with the stock connection), save, exit, and tell CCW to continue the update.

Another good thing to note is that the Claude for Excel (CFE) add-in has none of the problems that CCW has, because it is working directly within Excel. It doesn’t serve the same purpose, of course, because CFE has no memory or ability to create reproduceable skills. So, if you’re doing one-time manipulations of Excel workbooks, CFE is the tool to use. If you’re doing periodic updates, you need CCW.

Great overview @tommyguy. Really appreciate you spelling out all of the details.

1 Like