.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

IWorkbook.Protect(String, Boolean, Boolean) Method

Protects the structure and windows of a workbook.

Namespace: DevExpress.Spreadsheet

Assembly: DevExpress.Spreadsheet.v20.2.Core.dll


void Protect(
    string password,
    bool lockStructure,
    bool lockWindows
Sub Protect(
    password As String,
    lockStructure As Boolean,
    lockWindows As Boolean


Name Type Description
password String

A string that specifies a password for the workbook. If an empty string is specified, the workbook can be unprotected without a password.

lockStructure Boolean

true, to lock the structure of the workbook (the position of the sheets); otherwise, false.

lockWindows Boolean

true, to prevent users from changing the position of worksheet windows; otherwise, false.


Locked structure of the workbook prevents users from adding or deleting worksheets, from hiding worksheets or displaying hidden worksheets. Locked windows option prevents users from freezing or unfreezing panes.

See Also