Page tree
Skip to end of metadata
Go to start of metadata

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

AllowSelectLockedCells

Sets or returns whether the worksheet will allow users to select locked cells when the worksheet is protected.

AllowSelectUnlockedCells

Sets or returns whether the worksheet will allow users to select unlocked cells when the worksheet is protected.

AllowFormatCells

Sets or returns whether the worksheet will allow users to format cells when the worksheet is protected.

AllowFormatRows

Sets or returns whether the worksheet will allow users to format rows when the worksheet is protected.

AllowFormatColumns

Sets or returns whether the worksheet will allow users to format columns when the worksheet is protected.

AllowInsertColumns

Sets or returns whether the worksheet will allow users to insert columns when the worksheet is protected.

AllowInsertRows

Sets or returns whether the worksheet will allow users to insert rows when the worksheet is protected.

AllowInsertHyperlinks

Sets or returns whether the worksheet will allow users to insert hyperlinks when the worksheet is protected.

AllowDeleteColumns

Sets or returns whether the worksheet will allow users to delete columns when the worksheet is protected.

AllowDeleteRows

Sets or returns whether the worksheet will allow users to delete rows when the worksheet is protected.

AllowSort

Sets or returns whether the worksheet will allow users to sort when the worksheet is protected.

AllowUseAutoFilter

Sets or returns whether the worksheet will allow users to use AutoFilters when the worksheet is protected.

AllowUsePivotTableReports

Sets or returns whether the worksheet will allow users to use PivotTable reports when the worksheet is protected.
  • No labels