Skip to main content
All docs
V26.1
  • Row

    WorkbookOptions.SecurityLoadingLimits Property

    Gets the security loading limits for a workbook.

    Namespace: DevExpress.Spreadsheet

    Assembly: DevExpress.Spreadsheet.v26.1.Core.dll

    Declaration

    public WorkbookSecurityLoadingLimits SecurityLoadingLimits { get; }

    Property Value

    Type Description
    WorkbookSecurityLoadingLimits

    An object that contains the security loading limits for a workbook.

    Property Paths

    You can access this nested property as listed below:

    Object Type Path to SecurityLoadingLimits
    Workbook
    .Options .SecurityLoadingLimits

    Remarks

    When a document exceeds the specified limit, the Workbook.SecurityLoadingLimitExceeded event fires. Set e.Handled = true in the event handler to allow the spreadsheet to continue loading despite the violation. This can be useful for log-only scenarios or staged rollouts.

    Example

    How to: Set Security Loading Limits

    The following code snippet sets security loading limits:

    using DevExpress.Spreadsheet;
    
    using (Workbook workbook = new Workbook())
    {
        WorkbookSecurityLoadingLimits securityLimits = workbook.Options.SecurityLoadingLimits;
    
        securityLimits.MaxFileSize = 50 * 1024 * 1024; // 50 MB
        securityLimits.MaxSheetColumnCount = 100;
        securityLimits.MaxSheetRowCount = 50;
        securityLimits.MaxWorksheetCount = 10;
    
        workbook.LoadDocument("Documents\\Sample.xlsx");
    }
    
    See Also