Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
Protects/unprotects the sheet with password and enhanced parameters below.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
XL | 7.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example |
---|---|---|
bookRef | The reference to the workbook. Please use XL.LoadBook to load a file. | $ref |
sheetIndex | The index of the sheet. This number ranges from 0 to XL.Book.SheetCount-1. | 0 |
protect | Whether to protect. Pass 1 to enable protection and 0 to disable. |
1 |
Password | The password to use. | |
ProtectEx | The new protection setting. This can be a list of several options or a number. |
"default" |
Returns OK or error.
Enhanced Protection value | Description |
default | Default protection. |
all | Nothing is allowed except cell selections. |
Objects | Objects are locked when the sheet is protected. |
Scenarios | Scenarios are locked when the sheet is protected. |
FormatCells | Formatting cells is allowed when the sheet is protected. |
FormatColumns | Formatting columns is allowed when the sheet is protected. |
FormatRows | Formatting rows is allowed when the sheet is protected. |
InsertColumns | Inserting columns is allowed when the sheet is protected. |
InsertRows | Inserting rows is allowed when the sheet is protected. |
InsertHyperlinks | Inserting hyperlinks is allowed when the sheet is protected. |
DeleteColumns | Deleting columns is allowed when the sheet is protected. |
DeleteRows | Deleting rows is allowed when the sheet is protected. |
SelLockedCells | Selection of locked cells is locked when the sheet is protected. |
Sort | Sorting is allowed when the sheet is protected. |
AutoFilter | Autofilters are allowed when the sheet is protected. |
PivotTables | Pivot tables are allowed when the sheet is protected. |
SelUnlockedCells | Selection of unlocked cells is locked when the sheet is protected. |
Created 22nd April 2017, last changed 22nd April 2017
XL.Sheet.SetProtect - XL.Sheet.SetRightToLeft
Feedback: Report problem or ask question.