ExcelWorksheetAgentTools Class
Provides AI agent tools for Excel worksheet management operations. Handles worksheet creation, renaming, deletion, and listing.
Inherited Members
Namespace: Syncfusion.AI.AgentTools.Excel
Assembly: Syncfusion.DocumentSDK.AI.AgentTools.dll
Syntax
public class ExcelWorksheetAgentTools : AgentToolBase<IWorkbook>
Constructors
ExcelWorksheetAgentTools(DocumentStorageManager)
Initializes a new instance of the ExcelWorksheetAgentTools class (Mode 2 — DocumentStorage).
Declaration
public ExcelWorksheetAgentTools(DocumentStorageManager manager)
Parameters
| Type | Name | Description |
|---|---|---|
| DocumentStorageManager | manager | The document storage manager. |
ExcelWorksheetAgentTools(ExcelWorkbookManager)
Initializes a new instance of the ExcelWorksheetAgentTools class (Mode 1 — InMemory).
Declaration
public ExcelWorksheetAgentTools(ExcelWorkbookManager manager)
Parameters
| Type | Name | Description |
|---|---|---|
| ExcelWorkbookManager | manager | The Excel workbook manager. |
Methods
CreateWorksheet(String, String, String)
Creates a new worksheet in the specified workbook.
Declaration
[Tool(Name = "CreateWorksheet", Description = "Creates a worksheet inside the specified workbook. workbookIdOrFilePath: The workbook ID (InMemory mode) or input file path (DocumentStorage mode). If sheetName is null, a default name is used.")]
public AgentToolResult CreateWorksheet([ToolParameter(Description = "The workbook ID (InMemory mode) or input file path (DocumentStorage mode)")] string workbookIdOrFilePath, [ToolParameter(Description = "Optional name for the worksheet")] string sheetName = null, [ToolParameter(Description = "Output file path for saving the result (DocumentStorage mode only).")] string outputFilePath = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | workbookIdOrFilePath | The workbook ID (InMemory mode) or input file path (DocumentStorage mode). |
| System.String | sheetName | Optional name for the new worksheet. If null, a default name is used. |
| System.String | outputFilePath | Output file path for saving the result (DocumentStorage mode only). |
Returns
| Type | Description |
|---|---|
| AgentToolResult | Result containing the name of the created worksheet. |
DeleteWorksheet(String, String, String)
Deletes a worksheet from the workbook.
Declaration
[Tool(Name = "DeleteWorksheet", Description = "Deletes a worksheet from the workbook. workbookIdOrFilePath: The workbook ID (InMemory mode) or input file path (DocumentStorage mode).")]
public AgentToolResult DeleteWorksheet([ToolParameter(Description = "The workbook ID (InMemory mode) or input file path (DocumentStorage mode)")] string workbookIdOrFilePath, [ToolParameter(Description = "The name of the worksheet to delete")] string worksheetName, [ToolParameter(Description = "Output file path for saving the result (DocumentStorage mode only).")] string outputFilePath = null)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | workbookIdOrFilePath | The workbook ID (InMemory mode) or input file path (DocumentStorage mode). |
| System.String | worksheetName | The name of the worksheet to delete. |
| System.String | outputFilePath | Output file path for saving the result (DocumentStorage mode only). |
Returns
| Type | Description |
|---|---|
| AgentToolResult | Result indicating success or failure. |