The AI Loadout

How to work with Google Sheets and Excel with an AI agent

For Excel files, let the agent edit them in your project with Python and openpyxl. For Google Sheets, use the Google Workspace CLI (gws) and its Sheets skill, or connect Grok Bot to Google Sheets. Always have the agent write to a copy first and check formulas before replacing the real file.

Checked against official docs on Oct 26, 2026.

Get the free starter kit. One short email a day when our setups change.

Free starter kit on signup: 2 Claude Code skills and 1 agent persona from our paid packs. By subscribing you agree to get The AI Loadout Daily, one email each morning. No spam, we never sell your email, and every email has a one-click unsubscribe link.

Claude Code

  1. Excel: put the .xlsx in your project and ask: "Use Python and openpyxl to add a monthly totals tab. Save as a new file."
  2. Google Sheets: npm install -g @googleworkspace/cli, gws auth setup, gws auth login -s sheets
  3. Copy the gws sheets skill into .claude/skills/ so Claude knows the commands

Codex

  1. Same gws setup, with the skill in .agents/skills/
  2. Ask Codex to read or update a sheet and show you the change first

Cursor

  1. Same gws setup, with the skill in .agents/skills/ or .cursor/skills/
  2. For Excel, ask the agent for a Python script you can rerun

Grok Bot

  1. Connect Google Sheets to Grok Bot
  2. Ask it to read, clean or chart the data
  3. For Excel, send the file and get an edited copy back

Gotchas

  • Agents sometimes write values where you need formulas. Ask for formulas.
  • Back up before bulk edits.
  • gws is not an official Google product, per its README.

The loadout for this job

FAQ

Can an AI agent edit Google Sheets?

Yes, through the Google Workspace CLI, a connector, or the Sheets API.

Can Claude Code edit Excel files?

Yes, by writing and running Python with openpyxl on the file.

Related how-tos

Sources

Commands change. Check the linked docs before you run anything. All how-to guides

Want tested skills and personas installed in one command? See the AI Loadout packs, from $9.