GemBox.Spreadsheet
  • Overview
  • Examples
  • Free version
  • Support
  • Pricelist

    Show / Hide Table of Contents

    WorksheetProtection Class

    Namespace:
    GemBox.Spreadsheet
    Assembly:
    GemBox.Spreadsheet.dll

    Protection settings. Supported in XLSX, XLSB and XLS only.

    • C#
    • VB.NET
    public sealed class WorksheetProtection
    Public NotInheritable Class WorksheetProtection
    Inheritance:
    Object
    WorksheetProtection
    Remarks

    Properties in this class are simply written to Excel file and have no effect on the behavior of this library. For more information on worksheet protection, consult Microsoft Excel documentation.

    Properties

    AllowDeletingColumns

    Gets or sets if deleting columns is allowed.

    • C#
    • VB.NET
    public bool AllowDeletingColumns { get; set; }
    Public Property AllowDeletingColumns As Boolean
    Property Value
    Boolean

    AllowDeletingRows

    Gets or sets if deleting rows is allowed.

    • C#
    • VB.NET
    public bool AllowDeletingRows { get; set; }
    Public Property AllowDeletingRows As Boolean
    Property Value
    Boolean

    AllowEditingObjects

    Gets or sets if editing objects is allowed.

    • C#
    • VB.NET
    public bool AllowEditingObjects { get; set; }
    Public Property AllowEditingObjects As Boolean
    Property Value
    Boolean

    AllowEditingScenarios

    Gets or sets if editing scenarios is allowed.

    • C#
    • VB.NET
    public bool AllowEditingScenarios { get; set; }
    Public Property AllowEditingScenarios As Boolean
    Property Value
    Boolean

    AllowFormattingCells

    Gets or sets if formatting cells is allowed.

    • C#
    • VB.NET
    public bool AllowFormattingCells { get; set; }
    Public Property AllowFormattingCells As Boolean
    Property Value
    Boolean

    AllowFormattingColumns

    Gets or sets if formatting columns is allowed.

    • C#
    • VB.NET
    public bool AllowFormattingColumns { get; set; }
    Public Property AllowFormattingColumns As Boolean
    Property Value
    Boolean

    AllowFormattingRows

    Gets or sets if formatting rows is allowed.

    • C#
    • VB.NET
    public bool AllowFormattingRows { get; set; }
    Public Property AllowFormattingRows As Boolean
    Property Value
    Boolean

    AllowInsertingColumns

    Gets or sets if inserting columns is allowed.

    • C#
    • VB.NET
    public bool AllowInsertingColumns { get; set; }
    Public Property AllowInsertingColumns As Boolean
    Property Value
    Boolean

    AllowInsertingHyperlinks

    Gets or sets if inserting hyperlinks is allowed.

    • C#
    • VB.NET
    public bool AllowInsertingHyperlinks { get; set; }
    Public Property AllowInsertingHyperlinks As Boolean
    Property Value
    Boolean

    AllowInsertingRows

    Gets or sets if inserting rows is allowed.

    • C#
    • VB.NET
    public bool AllowInsertingRows { get; set; }
    Public Property AllowInsertingRows As Boolean
    Property Value
    Boolean

    AllowSelectingLockedCells

    Gets or sets if selecting locked cells is allowed. Default value is true.

    • C#
    • VB.NET
    public bool AllowSelectingLockedCells { get; set; }
    Public Property AllowSelectingLockedCells As Boolean
    Property Value
    Boolean

    AllowSelectingUnlockedCells

    Gets or sets if selecting unlocked cells is allowed. Default value is true.

    • C#
    • VB.NET
    public bool AllowSelectingUnlockedCells { get; set; }
    Public Property AllowSelectingUnlockedCells As Boolean
    Property Value
    Boolean

    AllowSorting

    Gets or sets if sorting is allowed.

    • C#
    • VB.NET
    public bool AllowSorting { get; set; }
    Public Property AllowSorting As Boolean
    Property Value
    Boolean

    AllowUsingAutoFilter

    Gets or sets if using autofilter is allowed.

    • C#
    • VB.NET
    public bool AllowUsingAutoFilter { get; set; }
    Public Property AllowUsingAutoFilter As Boolean
    Property Value
    Boolean

    AllowUsingPivotTableReports

    Gets or sets if using pivot table reports is allowed.

    • C#
    • VB.NET
    public bool AllowUsingPivotTableReports { get; set; }
    Public Property AllowUsingPivotTableReports As Boolean
    Property Value
    Boolean

    HasPassword

    Gets a value indicating whether the protected sheet has a passoword.

    • C#
    • VB.NET
    public bool HasPassword { get; }
    Public ReadOnly Property HasPassword As Boolean
    Property Value
    Boolean

    PasswordHash

    Gets or sets the password hash for protected sheet.

    • C#
    • VB.NET
    public int PasswordHash { get; set; }
    Public Property PasswordHash As Integer
    Property Value
    Int32
    Remarks

    This property needs to be set to ushort value (property is of type int because ushort is not CLS compliant). For setting a password, the SetPassword(String) method can also be used.

    Methods

    SetPassword(String)

    Sets the password for protected sheet.

    • C#
    • VB.NET
    public void SetPassword(string password)
    Public Sub SetPassword(password As String)
    Parameters
    password
    String

    The password.

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.