Protection Class
Represents the various types of protection options available for a worksheet. Only used in ExcelXP and above version.
Inheritance Hierarchy
SystemObject
  Aspose.CellsProtection

Namespace: Aspose.Cells
Assembly: Aspose.Cells (in Aspose.Cells.dll) Version: 19.11.0.0 (19.11)
Syntax
public class Protection

The Protection type exposes the following members.

Properties
  NameDescription
Public propertyAllowDeletingColumn
Represents if the deletion of columns is allowed on a protected worksheet.
Public propertyAllowDeletingRow
Represents if the deletion of rows is allowed on a protected worksheet.
Public propertyAllowEditingContent
Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
Public propertyAllowEditingObject
Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
Public propertyAllowEditingScenario
Represents if the user is allowed to edit scenarios on a protected worksheet.
Public propertyAllowFiltering
Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
Public propertyAllowFormattingCell
Represents if the formatting of cells is allowed on a protected worksheet.
Public propertyAllowFormattingColumn
Represents if the formatting of columns is allowed on a protected worksheet
Public propertyAllowFormattingRow
Represents if the formatting of rows is allowed on a protected worksheet
Public propertyAllowInsertingColumn
Represents if the insertion of columns is allowed on a protected worksheet
Public propertyAllowInsertingHyperlink
Represents if the insertion of hyperlinks is allowed on a protected worksheet
Public propertyAllowInsertingRow
Represents if the insertion of rows is allowed on a protected worksheet
Public propertyAllowSelectingLockedCell
Represents if the user is allowed to select locked cells on a protected worksheet.
Public propertyAllowSelectingUnlockedCell
Represents if the user is allowed to select unlocked cells on a protected worksheet.
Public propertyAllowSorting
Represents if the sorting option is allowed on a protected worksheet.
Public propertyAllowUsingPivotTable
Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
Public propertyIsDeletingColumnsAllowed Obsolete.
Represents if the deletion of columns is allowed on a protected worksheet.
Public propertyIsDeletingRowsAllowed Obsolete.
Represents if the deletion of rows is allowed on a protected worksheet.
Public propertyIsEditingContentsAllowed Obsolete.
Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
Public propertyIsEditingObjectsAllowed Obsolete.
Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
Public propertyIsEditingScenariosAllowed Obsolete.
Represents if the user is allowed to edit scenarios on a protected worksheet.
Public propertyIsFilteringAllowed Obsolete.
Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
Public propertyIsFormattingCellsAllowed Obsolete.
Represents if the formatting of cells is allowed on a protected worksheet.
Public propertyIsFormattingColumnsAllowed Obsolete.
Represents if the formatting of columns is allowed on a protected worksheet
Public propertyIsFormattingRowsAllowed Obsolete.
Represents if the formatting of rows is allowed on a protected worksheet
Public propertyIsInsertingColumnsAllowed Obsolete.
Represents if the insertion of columns is allowed on a protected worksheet
Public propertyIsInsertingHyperlinksAllowed Obsolete.
Represents if the insertion of hyperlinks is allowed on a protected worksheet
Public propertyIsInsertingRowsAllowed Obsolete.
Represents if the insertion of rows is allowed on a protected worksheet
Public propertyIsProtectedWithPassword
Indicates whether the worksheets is protected with password.
Public propertyIsSelectingLockedCellsAllowed Obsolete.
Represents if the user is allowed to select locked cells on a protected worksheet.
Public propertyIsSelectingUnlockedCellsAllowed Obsolete.
Represents if the user is allowed to select unlocked cells on a protected worksheet.
Public propertyIsSortingAllowed Obsolete.
Represents if the sorting option is allowed on a protected worksheet.
Public propertyIsUsingPivotTablesAllowed Obsolete.
Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
Public propertyPassword
Represents the password to protect the worksheet.
Methods
  NameDescription
Public methodCopy
Copy protection info.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetPasswordHash
Gets the hash of current password.
Public methodGetType
Gets the type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodVerifyPassword
Verifies password.
Examples
[C#]

//Allowing users to select locked cells of the worksheet
worksheet.Protection.AllowSelectingLockedCell = true;
//Allowing users to select unlocked cells of the worksheet
worksheet.Protection.AllowSelectingUnlockedCell = true;  

[Visual Basic]

'Allowing users to select locked cells of the worksheet
worksheet.Protection.AllowSelectingLockedCell = True
'Allowing users to select unlocked cells of the worksheet
worksheet.Protection.AllowSelectingUnlockedCell = True
See Also