通过托管 OAuth 集成 Microsoft Excel API,实现对 OneDrive 中 Excel 工作簿、工作表、区域、表格和图表的读写。使用此技能...
Access Microsoft Excel via the Microsoft Graph API with managed OAuth authentication. Read and write workbooks, worksheets, ranges, tables, and charts stored in OneDrive or SharePoint.
This skill uses ClawLink for hosted connection flows and credentials so you do not need to configure Microsoft Excel API access yourself.
Step 1: InstallStep 2: Pair AccountStep 3: Connect Excel

Run the install command in OpenClawSign in and approve the deviceOpen the dashboard and connect Microsoft Excel
text
┌─────────────────┐ ┌──────────────┐ ┌──────────────────┐
│ OpenClaw │────▶│ ClawLink │────▶│ Microsoft Graph │
│ (User Chat) │ │ (OAuth) │ │ (Excel API) │
└─────────────────┘ └──────────────┘ └──────────────────┘
│ │ │
│ 1. Install Plugin │ │
│ 2. Pair Device │ │
│ 3. Connect Excel │ │
│ │ 4. Secure Token │
│ │ 5. Proxy Requests │
│ │ │
▼ ▼ ▼
┌──────────┐ ┌──────────┐ ┌──────────┐
│ SKILL │ │ Dashboard│ │ OneDrive │
│ File │ │ Auth │ │ Excel │
└──────────┘ └──────────┘ └──────────┘
Install the verified ClawLink plugin from ClawHub. After the user confirms, complete the full setup so ClawLink tools are visible in the next OpenClaw chat.
bash
openclaw plugins install clawhub:clawlink-plugin
openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
openclaw gateway restart
Then tell the user: "OpenClaw has been restarted. Send /new as a standalone message to start a fresh chat, then ask for Microsoft Excel again."
bash
# List worksheets in a workbook
clawlink_call_tool --tool "excel_list_worksheets" --params '{"file_id": "WORKBOOK_ID"}'
# Read a cell range
clawlink_call_tool --tool "excel_get_range" --params '{"file_id": "WORKBOOK_ID", "worksheet_name": "Sheet1", "range_address": "A1:B10"}'
# Update a cell range
clawlink_call_tool --tool "excel_update_range" --params '{"file_id": "WORKBOOK_ID", "worksheet_name": "Sheet1", "range_address": "A1:B2", "values": [["Name", "Age"], ["Alice", 30]]}'
All Microsoft Excel tool calls are authenticated automatically by ClawLink using the user's connected Microsoft account.
No API key is required in chat. ClawLink stores the OAuth token securely and injects it into every Microsoft Graph request on the user's behalf.
clawlink_begin_pairing if it is not configured yet.clawlink_list_integrations to verify the connection is active.bash
clawlink_list_integrations
Response: Returns all connected integrations. Look for microsoft-excel in the list.
bash
clawlink_list_tools --integration microsoft-excel
Response: Returns the live tool catalog for Microsoft Excel.
If Microsoft Excel tools are missing or the connection shows an error:
clawlink_list_integrations to verifyclawlink_list_tools --integration microsoft-excelYou can access workbooks using either OneDrive or SharePoint paths:
By File ID (OneDrive):
bash
clawlink_call_tool --tool "excel_get_workbook" --params '{"file_id": "YOUR_FILE_ID"}'
By File Path (OneDrive):
bash
clawlink_call_tool --tool "excel_search_files" --params '{"query": "workbook.xlsx"}'
SharePoint workbooks:
Use the sharepoint variants of tools (e.g., excel_get_sharepoint_worksheet, excel_update_sharepoint_range).
excel_list_workbook_permissions and granted with excel_add_workbook_permission.ToolDescriptionModeexcel_search_filesSearch OneDrive for Excel workbook IDs by name or queryReadexcel_list_filesList files and folders in a drive root or pathReadexcel_list_drive_item_childrenList immediate children of a folder with paginationReadexcel_create_workbookCreate a new .xlsx file with worksheets and data in OneDriveWriteexcel_upload_workbookUpload an external Excel file from a URL into OneDrive/SharePointWriteexcel_export_workbook_to_pdfExport an Excel workbook to PDF via Microsoft GraphWrite
ToolDescriptionModeexcel_get_sessionCreate a persistent workbook session for batch operationsWriteexcel_close_sessionClose an active workbook session to release locksWrite
Note: Sessions expire after ~5 minutes of inactivity (persistent) or ~7 minutes (non-persistent). Pass the session_id in subsequent write operations when available.
ToolDescriptionModeexcel_list_worksheetsList all worksheets in a workbookReadexcel_get_worksheetGet a worksheet by name or IDReadexcel_add_worksheetAdd a new worksheet to a workbookWriteexcel_update_worksheetRename or reposition a worksheetWriteexcel_delete_worksheetDelete a worksheet from the workbookWriteexcel_protect_worksheetProtect a worksheet from editingWriteexcel_get_worksheet_used_rangeGet the active data region of a worksheetRead
ToolDescriptionModeexcel_get_rangeRead values, formulas, and formatting from a cell rangeReadexcel_update_rangeUpdate values and formatting in a cell rangeWriteexcel_clear_rangeClear contents, formats, or both from a rangeWriteexcel_insert_rangeInsert cells, shifting existing content down or rightWriteexcel_sort_rangeSort a range by one or more columnsWriteexcel_merge_cellsMerge cells in a worksheet rangeWrite
ToolDescriptionModeexcel_list_tablesList all tables in a worksheetReadexcel_get_table_columnGet a specific table column by ID or nameReadexcel_list_table_columnsList all columns in a tableReadexcel_list_table_rowsList all rows in a tableReadexcel_add_tableCreate a new table from a rangeWriteexcel_update_tableUpdate table properties (name, style, totals)Writeexcel_add_table_rowAppend a row to a tableWriteexcel_add_table_columnAppend a column to a tableWriteexcel_delete_table_rowDelete a row from a table by indexWriteexcel_delete_table_columnDelete a column from a table by indexWriteexcel_apply_table_filterApply a filter to a table columnWriteexcel_clear_table_filterClear an existing filter from a tableWriteexcel_apply_table_sortApply a sort to a tableWriteexcel_convert_table_to_rangeConvert a table back to a plain rangeWrite
ToolDescriptionModeexcel_list_chartsList all charts in a worksheetReadexcel_list_chart_seriesList data series in a chartReadexcel_get_chart_axisRetrieve axis properties (min, max, interval)Readexcel_get_chart_data_labelsRetrieve chart data label settingsReadexcel_get_chart_legendRetrieve chart legend visibility and formattingReadexcel_add_chartAdd a new chart to a worksheetWriteexcel_update_chartUpdate an existing chartWriteexcel_update_chart_legendUpdate chart legend position or formattingWrite
ToolDescriptionModeexcel_list_sharepoint_worksheetsList worksheets in a SharePoint workbookReadexcel_get_sharepoint_worksheetGet a worksheet from a SharePoint workbookReadexcel_get_sharepoint_rangeRead a range from a SharePoint worksheetReadexcel_update_sharepoint_rangeUpdate a range in a SharePoint worksheetWriteexcel_list_sharepoint_tablesList tables in a SharePoint worksheetReadexcel_add_sharepoint_worksheetAdd a worksheet to a SharePoint workbookWrite
ToolDescriptionModeexcel_get_workbookRetrieve workbook properties, tables, and worksheetsReadexcel_list_named_itemsList named ranges and items in a workbookReadexcel_list_commentsList all comments in a workbookReadexcel_list_workbook_permissionsList sharing permissions on a workbook fileReadexcel_add_workbook_permissionGrant access to a workbook via inviteWrite
bash
clawlink_call_tool --tool "excel_get_range" \
--params '{
"file_id": "YOUR_FILE_ID",
"worksheet_name": "Sheet1",
"range_address": "A1:C10"
}'
bash
clawlink_call_tool --tool "excel_update_range" \
--params '{
"file_id": "YOUR_FILE_ID",
"worksheet_name": "Sheet1",
"range_address": "A1:B2",
"values": [["Updated", "Values"], [100, 200]]
}'
bash
clawlink_call_tool --tool "excel_add_table" \
--params '{
"file_id": "YOUR_FILE_ID",
"worksheet_name": "Sheet1",
"address": "A1:C4",
"has_headers": true
}'
bash
clawlink_call_tool --tool "excel_add_table_row" \
--params '{
"file_id": "YOUR_FILE_ID",
"table_name": "Table1",
"values": [["Carol", 35, "Chicago"]]
}'
bash
clawlink_call_tool --tool "excel_add_chart" \
--params '{
"file_id": "YOUR_FILE_ID",
"worksheet_name": "Sheet1",
"type": "ColumnClustered",
"source_data": "A1:C4",
"series_by": "Auto"
}'
clawlink_list_integrations to confirm Microsoft Excel is connected.clawlink_list_tools --integration microsoft-excel to see the live catalog.clawlink_search_tools with a short query and integration microsoft-excel.text
┌─────────────────────────────────────────────────────────────┐
│ READ OPERATIONS (Safe) │
│ list → get → search → describe → call │
│ │
│ Example: List worksheets → Read range → Show results │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ WRITE OPERATIONS (Require Confirmation) │
│ list → get → describe → preview → confirm → call │
│ │
│ Example: Describe tool → Preview changes → User approves │
│ → Execute update │
└─────────────────────────────────────────────────────────────┘
clawlink_describe_tool first.whenToUse, askBefore, safeDefaults, examples, and followups to shape the call.clawlink_preview_tool first.clawlink_call_tool. Pass confirmation only after the preview matches the user's intent..xlsx files are supported (not legacy .xls).{ and } must be URL-encoded ( %7B and %7D) in raw Graph URLs. ClawLink handles this automatically.null in value arrays to skip updating specific cells."" (empty string).A1:C10, Sheet1!A1:B5).Status / ErrorMeaningTool not foundThe tool name does not exist in the current catalog. Verify with clawlink_list_tools --integration microsoft-excel.Missing connectionMicrosoft Excel is not connected. Direct the user to https://claw-link.dev/dashboard?add=microsoft-excel.ItemNotFoundFile or resource does not exist. Check the file_id or path.ItemAlreadyExistsWorksheet or table with that name already exists.InvalidArgumentInvalid parameter or missing required field. Review the tool schema with clawlink_describe_tool.SessionNotFoundSession expired or does not exist. Create a new session with excel_get_session.Write rejectedUser did not confirm a write action. Always confirm before executing writes.
Check that the ClawLink plugin is installed: bash
openclaw plugins list
If the plugin is installed but tools are missing, tell the user to send /new as a standalone message to reload the catalog.
If a fresh chat does not help, run: bash
openclaw config set tools.alsoAllow '["clawlink-plugin"]' --strict-json
openclaw gateway restart
After restart, tell the user to send /new again and retry.
microsoft-excel.clawlink_describe_tool to verify parameter names and types before calling.clawlink_preview_tool first.Powered by ClawLink — an integration hub for OpenClaw
