Introduced in build 8.6.1
Description
A SheetProtection
object contains sheet level protection properties that control what users can interact with when a worksheet is protected. To access SheetProtection
, use Worksheet.SheetProtection.
C#
vb.net
Remarks
In a new workbook, AllowSelectLockedCells and AllowSelectUnlockedCells default to true
. The rest of the properties default to false
.
The SheetProtection
properties will only take effect if the worksheet is protected. Worksheets can be protected with Worksheet.Protect(String). If the worksheet is not protected, the values of the properties will persist, but will not have an effect.
Examples
C#
vb.net
Properties
Name |
Description |
---|---|
Sets or returns whether the worksheet will allow users to select locked cells when the worksheet is protected. | |
Sets or returns whether the worksheet will allow users to select unlocked cells when the worksheet is protected. | |
Sets or returns whether the worksheet will allow users to format cells when the worksheet is protected. | |
Sets or returns whether the worksheet will allow users to format rows when the worksheet is protected. | |
Sets or returns whether the worksheet will allow users to format columns when the worksheet is protected. | |
Sets or returns whether the worksheet will allow users to insert columns when the worksheet is protected. | |
Sets or returns whether the worksheet will allow users to insert rows when the worksheet is protected. | |
Sets or returns whether the worksheet will allow users to insert hyperlinks when the worksheet is protected. | |
Sets or returns whether the worksheet will allow users to delete columns when the worksheet is protected. | |
Sets or returns whether the worksheet will allow users to delete rows when the worksheet is protected. | |
Sets or returns whether the worksheet will allow users to sort when the worksheet is protected. | |
Sets or returns whether the worksheet will allow users to use AutoFilters when the worksheet is protected. | |
Sets or returns whether the worksheet will allow users to use PivotTable reports when the worksheet is protected. |