Spread Windows Forms 15.0
GrapeCity.Spreadsheet Assembly / GrapeCity.Spreadsheet Namespace / Workbook Class / Protect Method
A WorkbookLocks value indicates which data will be protected.
A string value that specifies a case-sensitive password for the worksheet or workbook.


In This Topic
    Protect Method (Workbook)
    In This Topic
    Protects a workbook so that it cannot be modified.
    Syntax
    'Declaration
     
    
    Public Function Protect( _
       ByVal locks As WorkbookLocks, _
       Optional ByVal password As String _
    ) As Boolean
    'Usage
     
    
    Dim instance As Workbook
    Dim locks As WorkbookLocks
    Dim password As String
    Dim value As Boolean
     
    value = instance.Protect(locks, password)
    public bool Protect( 
       WorkbookLocks locks,
       string password
    )

    Parameters

    locks
    A WorkbookLocks value indicates which data will be protected.
    password
    A string value that specifies a case-sensitive password for the worksheet or workbook.

    Return Value

    true if the workbook is protected successful, false otherwise.
    Remarks
    Note that support for WorkbookLocks is limited to reading and writing the OpenXML file. All options of WorkbookLocks have same effect in runtime.
    See Also