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

    Show / Hide Table of Contents

    WriteProtection Class

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

    Write protection settings. Supported in XLSX only.

    • C#
    • VB.NET
    public sealed class WriteProtection
    Public NotInheritable Class WriteProtection
    Inheritance:
    System.Object
    WriteProtection
    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 write protection, consult Microsoft Excel documentation.

    Properties

    Author

    Gets and sets the author.

    • C#
    • VB.NET
    public string Author { get; set; }
    Public Property Author As String
    Property Value
    System.String

    HasPassword

    Gets a value indicating whether the workbook has write protection password.

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

    PasswordHash

    Gets or sets the password hash.

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

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

    ReadOnlyRecommended

    Gets or sets option that specifies if applications should provide user interface recommending that the user open this spreadsheet in write protected state.

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

    true if applications should provide user interface recommending that the user open this spreadsheet in write protected state; otherwise, false.

    Methods

    SetPassword(String)

    Sets the password for write protection.

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

    The password.

    Back to top

    Facebook • Twitter • LinkedIn

    © GemBox Ltd. — All rights reserved.