Excel Automation: create workbooks, manage worksheets, read/write cell data, and format spreadsheets via Microsoft Excel and Google Sheets integration
复制下面这句话,粘贴给 Claude Code、Codex、Cursor 等 AI 编程工具,它会读取安装说明并在你确认后完成安装。
请阅读 https://ai.atlankj.com/install/asset/gh-excel-automation-52d9478d117e ,按照其中的说明把「Excel Automation」安装到你(当前 AI 工具)中。执行前先告诉我将运行的命令和写入的位置,等我确认。
查看 AI 将读取的安装说明正在读取 GitHub 原文…
内容来自 GitHub 原始文件,由原作者维护。在 GitHub 查看
Automate spreadsheet operations including creating workbooks, writing data, formatting cells, upserting rows, and managing worksheets. Works with Microsoft Excel (OneDrive) and Google Sheets.
Toolkit docs: composio.dev/toolkits/excel
This skill requires the Rube MCP server connected at https://rube.app/mcp.
Before executing any tools, ensure an active connection exists for the excel (and optionally googlesheets) toolkit. If no connection is active, initiate one via RUBE_MANAGE_CONNECTIONS.
Use EXCEL_CREATE_WORKBOOK to generate a new .xlsx file and upload it to OneDrive.
Tool: EXCEL_CREATE_WORKBOOK
Steps:
EXCEL_CREATE_WORKBOOK with worksheet names and data.xlsx file and uploads it to OneDriveUse GOOGLESHEETS_BATCH_UPDATE to write values to a specific range or append rows.
Tool: GOOGLESHEETS_BATCH_UPDATE
Key Parameters:
spreadsheet_id (required) -- The spreadsheet ID from the URL (44-char alphanumeric string)sheet_name (required) -- Tab name, e.g., "Sheet1", "Sales Data"values (required) -- 2D array of cell values, e.g., [["Name","Amount"],["Alice",100]]first_cell_location -- Starting cell in A1 notation (e.g., "A1", "D3"). Omit to append rowsvalueInputOption -- "USER_ENTERED" (default, parses formulas) or "RAW" (stores as-is)Example:
Tool: GOOGLESHEETS_BATCH_UPDATE
Arguments:
spreadsheet_id: "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
sheet_name: "Sheet1"
values: [["Item","Cost","Stocked"],["Wheel",20.50,true],["Screw",0.50,true]]
first_cell_location: "A1"
Use GOOGLESHEETS_UPSERT_ROWS to update existing rows by matching a key column, or append new rows if no match is found. Ideal for CRM syncs, inventory updates, and deduplication.
Tool: GOOGLESHEETS_UPSERT_ROWS
Key Parameters:
spreadsheetId (required) -- The spreadsheet IDsheetName (required) -- Tab namerows (required) -- 2D array of data rows (min 1 row). If headers is omitted, the first row is treated as headersheaders -- Column names for the data, e.g., ["Email","Phone","Status"]keyColumn -- Column header to match on, e.g., "Email", "SKU", "Lead ID"strictMode -- true (default) errors on mismatched columns; false truncates silentlyExample:
Tool: GOOGLESHEETS_UPSERT_ROWS
Arguments:
spreadsheetId: "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
sheetName: "Contacts"
keyColumn: "Email"
headers: ["Email","Phone","Status"]
rows: [["john@example.com","555-0101","Active"],["jane@example.com","555-0102","Pending"]]
Use GOOGLESHEETS_FORMAT_CELL to apply bold, italic, font size, and background colors to ranges.
Tool: GOOGLESHEETS_FORMAT_CELL
Key Parameters:
spreadsheet_id (required) -- The spreadsheet IDrange -- Cell range in A1 notation, e.g., "A1:D1", "B2:B10" (recommended over index-based)sheet_name -- Worksheet name, e.g., "Sheet1"bold -- true/falseitalic -- true/falsefontSize -- Font size in points, e.g., 12red, green, blue -- Background color components (0.0--1.0 float scale, NOT 0--255)Example (bold header row with blue background):
Tool: GOOGLESHEETS_FORMAT_CELL
Arguments:
spreadsheet_id: "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
range: "A1:D1"
sheet_name: "Sheet1"
bold: true
fontSize: 12
red: 0.2
green: 0.4
blue: 0.9
Use GOOGLESHEETS_ADD_SHEET to create new tabs within an existing spreadsheet.
Tool: GOOGLESHEETS_ADD_SHEET
Key Parameters:
spreadsheetId (required) -- The spreadsheet IDtitle -- Name for the new tab, e.g., "Q4 Report"forceUnique -- true (default) auto-appends suffix if name existsExample:
Tool: GOOGLESHEETS_ADD_SHEET
Arguments:
spreadsheetId: "1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms"
title: "Q4 Report"
forceUnique: true
Use GOOGLESHEETS_BATCH_GET to retrieve data from specified cell ranges for validation or further processing.
Tool: GOOGLESHEETS_BATCH_GET
Steps:
GOOGLESHEETS_BATCH_GET with the spreadsheet ID and target rangesSupporting Tools:
GOOGLESHEETS_GET_SHEET_NAMES -- List all tab names in a spreadsheetGOOGLESHEETS_GET_SPREADSHEET_INFO -- Get metadata (sheet IDs, properties)GOOGLESHEETS_FIND_WORKSHEET_BY_TITLE -- Check if a specific tab existsGOOGLESHEETS_CREATE_GOOGLE_SHEET1 or reuse an existing spreadsheetIdGOOGLESHEETS_GET_SHEET_NAMES or GOOGLESHEETS_FIND_WORKSHEET_BY_TITLE; create it with GOOGLESHEETS_ADD_SHEET if missingGOOGLESHEETS_BATCH_GET to align columnsGOOGLESHEETS_BATCH_UPDATE or GOOGLESHEETS_UPSERT_ROWSGOOGLESHEETS_FORMAT_CELLGOOGLESHEETS_BATCH_GETEXCEL_CREATE_WORKBOOK for local .xlsx output| Pitfall | Detail |
|---|---|
| HTTP 403 on sheet creation | GOOGLESHEETS_CREATE_GOOGLE_SHEET1 fails when Drive create scope is missing. Reuse an existing spreadsheetId or fall back to EXCEL_CREATE_WORKBOOK. |
| Cell limit and rate throttling | Google Sheets has a ~5,000,000 cell limit per spreadsheet. Excessive write frequency triggers HTTP 429. Batch changes and chunk large writes (~500 rows/call). |
| Format range off-by-one | GOOGLESHEETS_FORMAT_CELL uses 0-based, endIndex-exclusive ranges when using index mode. Background color uses 0--1 float RGB, NOT 0--255 integer RGB. |
| Sheet title uniqueness | Sheet titles are not guaranteed unique across API responses. Prefer operating by numeric sheetId and verify the resolved tab before writing. |
| Upsert payload shape | GOOGLESHEETS_UPSERT_ROWS requires headers + 2D rows array. Sending list-of-dicts or empty rows causes validation errors. Ensure at least 1 data row. |
| Tool Slug | Description |
|---|---|
EXCEL_CREATE_WORKBOOK | Create a new .xlsx workbook and upload to OneDrive |
GOOGLESHEETS_BATCH_UPDATE | Write values to a range or append new rows |
GOOGLESHEETS_UPSERT_ROWS | Update existing rows by key or append new ones |
GOOGLESHEETS_FORMAT_CELL | Apply text/background formatting to cell ranges |
GOOGLESHEETS_ADD_SHEET | Add a new worksheet tab to a spreadsheet |
GOOGLESHEETS_CREATE_GOOGLE_SHEET1 | Create a new Google Spreadsheet in Drive |
GOOGLESHEETS_GET_SHEET_NAMES | List all worksheet names in a spreadsheet |
GOOGLESHEETS_GET_SPREADSHEET_INFO | Retrieve spreadsheet metadata |
GOOGLESHEETS_FIND_WORKSHEET_BY_TITLE | Check if a worksheet exists by title |
GOOGLESHEETS_BATCH_GET | Read data from specified cell ranges |
Powered by Composio