Overview
Enable your agents to create and manage Excel workbooks, worksheets, tables, and charts in OneDrive or SharePoint. Manipulate data ranges, create visualizations, manage tables, and streamline your spreadsheet workflows with AI-powered automation.Prerequisites
Before using the Microsoft Excel integration, ensure you have:- A CrewAI AMP account with an active subscription
- A Microsoft 365 account with Excel and OneDrive/SharePoint access
- Connected your Microsoft account through the Integrations page
Setting Up Microsoft Excel Integration
1. Connect Your Microsoft Account
- Navigate to CrewAI AMP Integrations
- Find Microsoft Excel in the Authentication Integrations section
- Click Connect and complete the OAuth flow
- Grant the necessary permissions for files and Excel workbook access
- Copy your Enterprise Token from Integration Settings
2. Install Required Package
Available Actions
microsoft_excel/create_workbook
microsoft_excel/create_workbook
Description: Create a new Excel workbook in OneDrive or SharePoint.Parameters:
file_path
(string, required): Path where to create the workbook (e.g., ‘MyWorkbook.xlsx’)worksheets
(array, optional): Initial worksheets to create
microsoft_excel/get_workbooks
microsoft_excel/get_workbooks
Description: Get all Excel workbooks from OneDrive or SharePoint.Parameters:
select
(string, optional): Select specific properties to returnfilter
(string, optional): Filter results using OData syntaxexpand
(string, optional): Expand related resources inlinetop
(integer, optional): Number of items to return. Minimum: 1, Maximum: 999orderby
(string, optional): Order results by specified properties
microsoft_excel/get_worksheets
microsoft_excel/get_worksheets
Description: Get all worksheets in an Excel workbook.Parameters:
file_id
(string, required): The ID of the Excel fileselect
(string, optional): Select specific properties to return (e.g., ‘id,name,position’)filter
(string, optional): Filter results using OData syntaxexpand
(string, optional): Expand related resources inlinetop
(integer, optional): Number of items to return. Minimum: 1, Maximum: 999orderby
(string, optional): Order results by specified properties
microsoft_excel/create_worksheet
microsoft_excel/create_worksheet
Description: Create a new worksheet in an Excel workbook.Parameters:
file_id
(string, required): The ID of the Excel filename
(string, required): Name of the new worksheet
microsoft_excel/get_range_data
microsoft_excel/get_range_data
Description: Get data from a specific range in an Excel worksheet.Parameters:
file_id
(string, required): The ID of the Excel fileworksheet_name
(string, required): Name of the worksheetrange
(string, required): Range address (e.g., ‘A1:C10’)
microsoft_excel/update_range_data
microsoft_excel/update_range_data
Description: Update data in a specific range in an Excel worksheet.Parameters:
file_id
(string, required): The ID of the Excel fileworksheet_name
(string, required): Name of the worksheetrange
(string, required): Range address (e.g., ‘A1:C10’)values
(array, required): 2D array of values to set in the range
microsoft_excel/add_table
microsoft_excel/add_table
Description: Create a table in an Excel worksheet.Parameters:
file_id
(string, required): The ID of the Excel fileworksheet_name
(string, required): Name of the worksheetrange
(string, required): Range for the table (e.g., ‘A1:D10’)has_headers
(boolean, optional): Whether the first row contains headers. Default: true
microsoft_excel/get_tables
microsoft_excel/get_tables
Description: Get all tables in an Excel worksheet.Parameters:
file_id
(string, required): The ID of the Excel fileworksheet_name
(string, required): Name of the worksheet
microsoft_excel/add_table_row
microsoft_excel/add_table_row
Description: Add a new row to an Excel table.Parameters:
file_id
(string, required): The ID of the Excel fileworksheet_name
(string, required): Name of the worksheettable_name
(string, required): Name of the tablevalues
(array, required): Array of values for the new row
microsoft_excel/create_chart
microsoft_excel/create_chart
Description: Create a chart in an Excel worksheet.Parameters:
file_id
(string, required): The ID of the Excel fileworksheet_name
(string, required): Name of the worksheetchart_type
(string, required): Type of chart (e.g., ‘ColumnClustered’, ‘Line’, ‘Pie’)source_data
(string, required): Range of data for the chart (e.g., ‘A1:B10’)series_by
(string, optional): How to interpret the data (‘Auto’, ‘Columns’, or ‘Rows’). Default: Auto
microsoft_excel/get_cell
microsoft_excel/get_cell
Description: Get the value of a single cell in an Excel worksheet.Parameters:
file_id
(string, required): The ID of the Excel fileworksheet_name
(string, required): Name of the worksheetrow
(integer, required): Row number (0-based)column
(integer, required): Column number (0-based)
microsoft_excel/get_used_range
microsoft_excel/get_used_range
Description: Get the used range of an Excel worksheet (contains all data).Parameters:
file_id
(string, required): The ID of the Excel fileworksheet_name
(string, required): Name of the worksheet
microsoft_excel/list_charts
microsoft_excel/list_charts
Description: Get all charts in an Excel worksheet.Parameters:
file_id
(string, required): The ID of the Excel fileworksheet_name
(string, required): Name of the worksheet
microsoft_excel/delete_worksheet
microsoft_excel/delete_worksheet
Description: Delete a worksheet from an Excel workbook.Parameters:
file_id
(string, required): The ID of the Excel fileworksheet_name
(string, required): Name of the worksheet to delete
microsoft_excel/delete_table
microsoft_excel/delete_table
Description: Delete a table from an Excel worksheet.Parameters:
file_id
(string, required): The ID of the Excel fileworksheet_name
(string, required): Name of the worksheettable_name
(string, required): Name of the table to delete
microsoft_excel/list_names
microsoft_excel/list_names
Description: Get all named ranges in an Excel workbook.Parameters:
file_id
(string, required): The ID of the Excel file
Usage Examples
Basic Excel Agent Setup
Data Analysis and Reporting
Workbook Creation and Structure
Data Manipulation and Updates
Advanced Excel Automation
Financial Modeling and Analysis
Troubleshooting
Common Issues
Permission Errors- Ensure your Microsoft account has appropriate permissions for Excel and OneDrive/SharePoint
- Verify that the OAuth connection includes required scopes (Files.Read.All, Files.ReadWrite.All)
- Check that you have access to the specific workbooks you’re trying to modify
- Verify that file IDs are correct and files exist in your OneDrive or SharePoint
- Ensure file paths are properly formatted when creating new workbooks
- Check that workbook files have the correct .xlsx extension
- Verify that worksheet names exist in the specified workbook
- Ensure range addresses are properly formatted (e.g., ‘A1:C10’)
- Check that ranges don’t exceed worksheet boundaries
- Ensure data values are properly formatted for Excel (strings, numbers, integers)
- Verify that 2D arrays for ranges have consistent row and column counts
- Check that table data includes proper headers when has_headers is true
- Verify that chart types are supported (ColumnClustered, Line, Pie, etc.)
- Ensure source data ranges contain appropriate data for the chart type
- Check that the source data range exists and contains data
- Ensure table names are unique within worksheets
- Verify that table ranges don’t overlap with existing tables
- Check that new row data matches the table’s column structure
- Verify that row and column indices are 0-based for cell operations
- Ensure ranges contain data when using get_used_range
- Check that named ranges exist before referencing them
Getting Help
Need Help?
Contact our support team for assistance with Microsoft Excel integration setup or troubleshooting.