Skip to main content
All docs
V26.1
  • Row

    WorkbookSanitizeOptions Class

    Specifies options for workbook content sanitization.

    Namespace: DevExpress.Spreadsheet

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

    Declaration

    public sealed class WorkbookSanitizeOptions :
        SanitizeOptions

    The following members return WorkbookSanitizeOptions objects:

    Example

    How to: Sanitize a Spreadsheet Document

    The following code snippet sanitizes hidden sheets and comments from a spreadsheet:

    using DevExpress.Office;
    using DevExpress.Spreadsheet;
    
    using (Workbook workbook = new Workbook())
    {
        workbook.LoadDocument("Documents\\Sample.xlsx");
    
        WorkbookSanitizeOptions sanitizeOptions = new WorkbookSanitizeOptions
        {
            RemoveThreadedComments = true,
            HiddenSheets = HiddenContentSanitizeMode.MakeVisible
        };
    
        var results = workbook.Sanitize(sanitizeOptions);
    
        foreach (var result in results)
        {
            Console.WriteLine($"Content type: {result.Type}, Action taken: {result.Action}");
        }
    }
    

    Inheritance

    Object
    SanitizeOptions
    WorkbookSanitizeOptions
    See Also