AI agent for Excel and Numbers on the Mac: fill spreadsheets from invoices, emails and web pages

Three ways to let an AI agent fill Excel or Numbers on a Mac: write the file directly, use an Excel add-in, or let the agent operate the apps. Example prompts, pitfalls and when each fits.

By Paul Kasten · Updated

Short answer: An AI agent can fill Excel or Numbers on the Mac in three ways: write the spreadsheet file directly (simplest when nobody has it open), use an add-in inside Excel such as Claude for Excel (good when everything it needs is in the workbook), or operate Excel or Numbers like a person with computer use (needed when the data sits in Mail, PDFs or web pages and goes into a sheet you keep open). ShadowCursor gives any MCP agent its own cursor, keyboard and clipboard for that third way, in windows behind yours.

Three ways to get data into a spreadsheet

WayBest forNot for
The agent writes the file (CSV or .xlsx from a script)New sheets, large amounts of rows, repeatable importsA workbook that is open and being edited, Numbers files with complex layout
An add-in inside Excel (Claude for Excel)Formulas, models and cleanup inside one workbookNumbers; data that lives outside the workbook
Computer use in Excel or NumbersCopying values from emails, PDFs and websites into an existing sheetThousands of rows, where a file import is faster

Start with the first row of that table. A coding agent such as Claude Code or Codex can read your PDF invoices, write a CSV and you import it: Numbers imports delimited and fixed-width text files and Excel spreadsheets (Apple's Numbers guide). For .xlsx files, a Python library such as openpyxl reads and writes workbooks without opening Excel at all. No clicking is needed, and the result is repeatable.

Claude for Excel is Anthropic's add-in that works inside Excel. It is available on Pro, Max, Team and Enterprise plans, runs on Excel on Mac version 16.46 or later, edits cells while keeping formulas intact, and does not support macros or VBA (Claude for Excel docs). It is the better choice when the work is inside the workbook. It does not cover Numbers.

When the agent should operate the app itself

Computer use earns its place when the sheet is a living document and the data is scattered:

  • the bookkeeping sheet you keep open all month, with formatting and formulas that a regenerated file would lose,
  • values in emails, PDF attachments and supplier portals that have to be read one by one,
  • Numbers, for which Anthropic documents no add-in,
  • a quick check that a sheet looks right after entry, which an agent reads from the window's screenshot.

Here the agent opens the invoice in Preview, the email in Mail or the supplier page in Safari, reads each value and types it into the right cell of the sheet, like a person would.

How it works with ShadowCursor

ShadowCursor is a Mac app and MCP server that gives Claude Code, Codex, Cursor, VS Code or any MCP client its own cursor, keyboard and clipboard. The agent works in background windows, even when your windows cover them, and sees only the windows it works in. Its keys arrive only in its target window, and when it copies a value in Safari and pastes it into Numbers it uses its own clipboard, not yours.

Example prompts

Add the invoices in ~/Downloads/invoices to the sheet "2026" in Expenses.numbers:
one row per invoice with date, supplier, net, VAT and gross. Do not change
existing rows or formulas. Afterwards read back the total in column F.
Go through the emails in the Mail folder "Orders" from this week and add each
order to Orders.xlsx in Excel: order number, customer, amount. Skip orders
that are already in the sheet.
Open the price list at https://example.com/prices in your own Safari window
and update column C of Suppliers.numbers with the current prices. List every
cell you changed.

Naming the file, the sheet, the columns and what must not change does more for accuracy than any other part of the prompt.

What happens step by step

  1. The agent opens the sources. It reads PDFs and files it can reach on disk directly, opens emails in Mail, and opens web pages in a Safari window of its own.
  2. It opens the spreadsheet in Excel or Numbers. If the file is already open in your window, tell it whether to work there or wait.
  3. It finds the right place. Every action returns a screenshot of the window and its accessibility elements, so it sees the sheet, the headers and the last filled row.
  4. It enters values cell by cell, with Tab and Return as you would, or pastes them from its own clipboard.
  5. It checks the result, for example by reading back totals or comparing the row count with the number of invoices.

If you type in the same app at the same time, the agent waits for your pauses. It is easier to let it work in a different document than the one you edit.

Pitfalls

Numbers turned into dates

Excel converts entries like 12/2 into dates. Microsoft's fix is to format the cells as Text first or type an apostrophe before the value (Microsoft support). Tell the agent which columns hold codes rather than numbers, such as order numbers with slashes or leading zeros.

Decimal separators

A sheet set up for German formatting expects 1.234,56, a US one 1,234.56. Say which format the sheet uses, especially when the invoices are in another language than the spreadsheet.

Autocorrect

Spreadsheet apps can correct words as they are typed, which changes supplier names and product codes. ShadowCursor detects such corrections and retypes the word, but ask for a list of entered values anyway.

Formulas and formatting

An agent typing over a formula cell replaces the formula. Name the columns it may write into, and keep a copy of the file before the first run.

File dialogs and drag and drop

Dragging an attachment from Mail into Finder, or a file onto a window, is a system drag that follows the real mouse; ShadowCursor cancels it. Give the agent file paths instead, and save email attachments to a folder before the run. The simplest way to open a file is to name its path in the prompt.

Window state and other apps

Minimized and hidden windows cannot be seen or operated; covered windows can. LibreOffice ignores posted clicks (menus and keyboard work), so Excel or Numbers is the better target.

Checking the work

Treat agent entry like entry by a new colleague. Ask for a list of every row or cell it changed, compare totals with the source, and spot-check a few rows against the original documents. For data that goes into tax filings or client reports, check every value. Several agents can share the work, each with its own cursor, keyboard and clipboard, as the guide to running several AI agents at once describes.

FAQ

Can an AI agent use Excel on a Mac?

Yes. Inside Excel, the Claude for Excel add-in works on the open workbook. From outside, an agent with computer use operates Excel like a person, which also lets it bring in data from Mail, Preview and Safari.

Does it work with Apple Numbers?

Yes, through computer use or by writing a CSV that you import. Anthropic's add-in is for Excel; Numbers is not listed.

Is writing a CSV not simpler?

Often, yes. For new sheets and large amounts of rows, have the agent write a CSV or .xlsx and import it. Operating the app pays off when the sheet already exists, stays open, and the data has to be gathered from many places.

Can the agent read PDF invoices?

Yes. A coding agent can read PDFs from disk, and with computer use it can also open them in Preview and read them from the window. Scanned invoices are read from the image, so check amounts carefully.

Does it touch my clipboard?

No. With ShadowCursor every agent has its own clipboard. When it copies a value in Safari and pastes it into Numbers, what you copied stays where it was.

What does ShadowCursor cost?

There is a 7-day free trial without a card, then $12.99 per month or $69.99 per year, with unlimited agents on up to three devices. It needs macOS 15 Sequoia or later.