Spread Windows Forms 15.0
GrapeCity.Spreadsheet Assembly / GrapeCity.Spreadsheet Namespace / IWorkbook Interface / 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 (IWorkbook)
    In This Topic
    Protects a workbook so that it cannot be modified.
    Syntax
    'Declaration
     
    
    Function Protect( _
       ByVal locks As WorkbookLocks, _
       Optional ByVal password As String _
    ) As Boolean
    'Usage
     
    
    Dim instance As IWorkbook
    Dim locks As WorkbookLocks
    Dim password As String
    Dim value As Boolean
     
    value = instance.Protect(locks, 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 and password is limited to reading and writing the OpenXML file. All options of WorkbookLocks have same effect in runtime.
    See Also