Spread Windows Forms 15.0
GrapeCity.Spreadsheet Assembly / GrapeCity.Spreadsheet Namespace / IWorksheet Interface / Protect Method
A WorksheetLocks value indicates which data will be protected.
A string that specifies a case-sensitive password for the worksheet.


In This Topic
    Protect Method (IWorksheet)
    In This Topic
    Protects a worksheet so that it cannot be modified.
    Syntax
    'Declaration
     
    
    Function Protect( _
       ByVal locks As WorksheetLocks, _
       Optional ByVal password As String _
    ) As Boolean
    'Usage
     
    
    Dim instance As IWorksheet
    Dim locks As WorksheetLocks
    Dim password As String
    Dim value As Boolean
     
    value = instance.Protect(locks, password)

    Parameters

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

    Return Value

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