Documents for Excel .NET Edition | GCDocuments
GrapeCity.Documents.Excel Namespace / Workbook Class / Protect Method / Protect(String,Boolean,Boolean) Method
Password to protect the workbook.
True to protect the structure of the workbook (To prevent other users from viewing hidden worksheets, adding, moving, deleting, or hiding worksheets, and renaming worksheets).
True to prevent users from moving, resizing, or closing the workbook window, or hide/unhide windows. This option is available only in Excel 2007, Excel 2010, Excel for Mac 2011, and Excel 2016 for Mac.
In This Topic
    Protect(String,Boolean,Boolean) Method
    In This Topic
    Protects a workbook so that it cannot be modified.
    Syntax
    public void Protect( 
       System.string password,
       System.bool structure,
       System.bool windows
    )

    Parameters

    password
    Password to protect the workbook.
    structure
    True to protect the structure of the workbook (To prevent other users from viewing hidden worksheets, adding, moving, deleting, or hiding worksheets, and renaming worksheets).
    windows
    True to prevent users from moving, resizing, or closing the workbook window, or hide/unhide windows. This option is available only in Excel 2007, Excel 2010, Excel for Mac 2011, and Excel 2016 for Mac.
    See Also