alexa
menu

Document Processing

    Show / Hide Table of Contents

    ExcelSecurityAgentTools Class

    Provides AI agent tools for Excel workbook and worksheet security operations. Handles encryption, decryption, and protection management. Supports dual-mode operation: InMemory and DocumentStorage.

    Inheritance
    System.Object
    AgentToolBase
    AgentToolBase<IWorkbook>
    ExcelSecurityAgentTools
    Inherited Members
    AgentToolBase<IWorkbook>.InMemoryManager
    AgentToolBase<IWorkbook>.Mode
    AgentToolBase<IWorkbook>.OpenDocument(String, String)
    AgentToolBase<IWorkbook>.SaveDocument(String, IWorkbook)
    AgentToolBase<IWorkbook>.SaveFile(String, Stream)
    AgentToolBase<IWorkbook>.StorageManager
    AgentToolBase.GetTools()
    Namespace: Syncfusion.AI.AgentTools.Excel
    Assembly: Syncfusion.DocumentSDK.AI.AgentTools.dll
    Syntax
    public class ExcelSecurityAgentTools : AgentToolBase<IWorkbook>

    Constructors

    ExcelSecurityAgentTools(DocumentStorageManager)

    Initializes a new instance of the ExcelSecurityAgentTools class for DocumentStorage mode.

    Declaration
    public ExcelSecurityAgentTools(DocumentStorageManager manager)
    Parameters
    Type Name Description
    DocumentStorageManager manager

    The document storage manager.

    ExcelSecurityAgentTools(ExcelWorkbookManager)

    Initializes a new instance of the ExcelSecurityAgentTools class for InMemory mode.

    Declaration
    public ExcelSecurityAgentTools(ExcelWorkbookManager manager)
    Parameters
    Type Name Description
    ExcelWorkbookManager manager

    The Excel workbook manager.

    Methods

    DecryptWorkbook(String, String, String)

    Removes encryption from the Excel workbook.

    Declaration
    [Tool(Name = "DecryptWorkbook", Description = "Removes encryption from the Excel workbook using the provided password. Supports InMemory and DocumentStorage modes.")]
    public AgentToolResult DecryptWorkbook([ToolParameter(Description = "The workbook ID (InMemory mode) or input file path (DocumentStorage mode)")] string workbookIdOrFilePath, [ToolParameter(Description = "The current password")] string password, [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 password

    The current password (for verification).

    System.String outputFilePath

    Output file path for saving the result (DocumentStorage mode only).

    Returns
    Type Description
    AgentToolResult

    Result indicating success or failure.

    EncryptWorkbook(String, String, String)

    Encrypts the Excel workbook with a password.

    Declaration
    [Tool(Name = "EncryptWorkbook", Description = "Encrypts the Excel workbook with the specified password. Supports InMemory and DocumentStorage modes.")]
    public AgentToolResult EncryptWorkbook([ToolParameter(Description = "The workbook ID (InMemory mode) or input file path (DocumentStorage mode)")] string workbookIdOrFilePath, [ToolParameter(Description = "The password to encrypt with")] string password, [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 password

    The password to encrypt the workbook.

    System.String outputFilePath

    Output file path for saving the result (DocumentStorage mode only).

    Returns
    Type Description
    AgentToolResult

    Result indicating success or failure.

    ProtectWorkbook(String, String, String)

    Protects the entire workbook structure with a password.

    Declaration
    [Tool(Name = "ProtectWorkbook", Description = "Protects the entire workbook structure with a password. Supports InMemory and DocumentStorage modes.")]
    public AgentToolResult ProtectWorkbook([ToolParameter(Description = "The workbook ID (InMemory mode) or input file path (DocumentStorage mode)")] string workbookIdOrFilePath, [ToolParameter(Description = "The password to protect with")] string password, [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 password

    The password to protect with.

    System.String outputFilePath

    Output file path for saving the result (DocumentStorage mode only).

    Returns
    Type Description
    AgentToolResult

    Result indicating success or failure.

    ProtectWorksheet(String, String, String, String)

    Protects a worksheet from editing using a password.

    Declaration
    [Tool(Name = "ProtectWorksheet", Description = "Protects the worksheet from editing using a password. Supports InMemory and DocumentStorage modes.")]
    public AgentToolResult ProtectWorksheet([ToolParameter(Description = "The workbook ID (InMemory mode) or input file path (DocumentStorage mode)")] string workbookIdOrFilePath, [ToolParameter(Description = "The name of the worksheet")] string worksheetName, [ToolParameter(Description = "The password to protect with")] string password, [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 protect.

    System.String password

    The password to protect with.

    System.String outputFilePath

    Output file path for saving the result (DocumentStorage mode only).

    Returns
    Type Description
    AgentToolResult

    Result indicating success or failure.

    UnprotectWorkbook(String, String, String)

    Removes workbook structure protection.

    Declaration
    [Tool(Name = "UnprotectWorkbook", Description = "Removes workbook structure protection. Supports InMemory and DocumentStorage modes.")]
    public AgentToolResult UnprotectWorkbook([ToolParameter(Description = "The workbook ID (InMemory mode) or input file path (DocumentStorage mode)")] string workbookIdOrFilePath, [ToolParameter(Description = "The protection password")] string password, [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 password

    The protection password.

    System.String outputFilePath

    Output file path for saving the result (DocumentStorage mode only).

    Returns
    Type Description
    AgentToolResult

    Result indicating success or failure.

    UnprotectWorksheet(String, String, String, String)

    Removes worksheet protection.

    Declaration
    [Tool(Name = "UnprotectWorksheet", Description = "Removes worksheet protection. Supports InMemory and DocumentStorage modes.")]
    public AgentToolResult UnprotectWorksheet([ToolParameter(Description = "The workbook ID (InMemory mode) or input file path (DocumentStorage mode)")] string workbookIdOrFilePath, [ToolParameter(Description = "The name of the worksheet")] string worksheetName, [ToolParameter(Description = "The protection password")] string password, [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.

    System.String password

    The protection password.

    System.String outputFilePath

    Output file path for saving the result (DocumentStorage mode only).

    Returns
    Type Description
    AgentToolResult

    Result indicating success or failure.

    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved