asposecells.api
Class Protection

Represents the various types of protection options available for a worksheet. Only used in ExcelXP and above version.

Example:

# Instantiating a Workbook object
workbook = Workbook()
# Adding a new worksheet to the Excel object
sheetIndex = workbook.getWorksheets().add()
worksheet = workbook.getWorksheets().get(sheetIndex)
# Allowing users to select locked cells of the worksheet
worksheet.getProtection().setAllowSelectingLockedCell(True)
# Allowing users to select unlocked cells of the worksheet
worksheet.getProtection().setAllowSelectingUnlockedCell(True)

Property Getters/Setters Summary
methodgetAllowDeletingColumn()
methodsetAllowDeletingColumn(value)
           Represents if the deletion of columns is allowed on a protected worksheet.
methodgetAllowDeletingRow()
methodsetAllowDeletingRow(value)
           Represents if the deletion of rows is allowed on a protected worksheet.
methodgetAllowEditingContent()
methodsetAllowEditingContent(value)
           Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
methodgetAllowEditingObject()
methodsetAllowEditingObject(value)
           Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
methodgetAllowEditingScenario()
methodsetAllowEditingScenario(value)
           Represents if the user is allowed to edit scenarios on a protected worksheet.
methodgetAllowFiltering()
methodsetAllowFiltering(value)
           Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
methodgetAllowFormattingCell()
methodsetAllowFormattingCell(value)
           Represents if the formatting of cells is allowed on a protected worksheet.
methodgetAllowFormattingColumn()
methodsetAllowFormattingColumn(value)
           Represents if the formatting of columns is allowed on a protected worksheet
methodgetAllowFormattingRow()
methodsetAllowFormattingRow(value)
           Represents if the formatting of rows is allowed on a protected worksheet
methodgetAllowInsertingColumn()
methodsetAllowInsertingColumn(value)
           Represents if the insertion of columns is allowed on a protected worksheet
methodgetAllowInsertingHyperlink()
methodsetAllowInsertingHyperlink(value)
           Represents if the insertion of hyperlinks is allowed on a protected worksheet
methodgetAllowInsertingRow()
methodsetAllowInsertingRow(value)
           Represents if the insertion of rows is allowed on a protected worksheet
methodgetAllowSelectingLockedCell()
methodsetAllowSelectingLockedCell(value)
           Represents if the user is allowed to select locked cells on a protected worksheet.
methodgetAllowSelectingUnlockedCell()
methodsetAllowSelectingUnlockedCell(value)
           Represents if the user is allowed to select unlocked cells on a protected worksheet.
methodgetAllowSorting()
methodsetAllowSorting(value)
           Represents if the sorting option is allowed on a protected worksheet.
methodgetAllowUsingPivotTable()
methodsetAllowUsingPivotTable(value)
           Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
methodisDeletingColumnsAllowed()
methodsetDeletingColumnsAllowed(value)
           Represents if the deletion of columns is allowed on a protected worksheet.
methodisDeletingRowsAllowed()
methodsetDeletingRowsAllowed(value)
           Represents if the deletion of rows is allowed on a protected worksheet.
methodisEditingContentsAllowed()
methodsetEditingContentsAllowed(value)
           Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
methodisEditingObjectsAllowed()
methodsetEditingObjectsAllowed(value)
           Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
methodisEditingScenariosAllowed()
methodsetEditingScenariosAllowed(value)
           Represents if the user is allowed to edit scenarios on a protected worksheet.
methodisFilteringAllowed()
methodsetFilteringAllowed(value)
           Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
methodisFormattingCellsAllowed()
methodsetFormattingCellsAllowed(value)
           Represents if the formatting of cells is allowed on a protected worksheet.
methodisFormattingColumnsAllowed()
methodsetFormattingColumnsAllowed(value)
           Represents if the formatting of columns is allowed on a protected worksheet
methodisFormattingRowsAllowed()
methodsetFormattingRowsAllowed(value)
           Represents if the formatting of rows is allowed on a protected worksheet
methodisInsertingColumnsAllowed()
methodsetInsertingColumnsAllowed(value)
           Represents if the insertion of columns is allowed on a protected worksheet
methodisInsertingHyperlinksAllowed()
methodsetInsertingHyperlinksAllowed(value)
           Represents if the insertion of hyperlinks is allowed on a protected worksheet
methodisInsertingRowsAllowed()
methodsetInsertingRowsAllowed(value)
           Represents if the insertion of rows is allowed on a protected worksheet
methodisProtectedWithPassword()
           Indicates whether the worksheets is protected with password.
methodisSelectingLockedCellsAllowed()
methodsetSelectingLockedCellsAllowed(value)
           Represents if the user is allowed to select locked cells on a protected worksheet.
methodisSelectingUnlockedCellsAllowed()
methodsetSelectingUnlockedCellsAllowed(value)
           Represents if the user is allowed to select unlocked cells on a protected worksheet.
methodisSortingAllowed()
methodsetSortingAllowed(value)
           Represents if the sorting option is allowed on a protected worksheet.
methodisUsingPivotTablesAllowed()
methodsetUsingPivotTablesAllowed(value)
           Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
methodgetPassword()
methodsetPassword(value)
           Represents the password to protect the worksheet.
 
Method Summary
methodcopy(source)
           Copy protection info.
methodgetPasswordHash()
           Gets the hash of current password.
methodverifyPassword(password)
           Verifies password.
 

Property Getters/Setters Detail

getAllowDeletingColumn/setAllowDeletingColumn : boolean 

boolean getAllowDeletingColumn() / setAllowDeletingColumn(value)
Represents if the deletion of columns is allowed on a protected worksheet. The columns containing the cells to be deleted must be unlocked when the sheet is protected, and "Select unlocked cells" option must be enabled.

isDeletingColumnsAllowed/setDeletingColumnsAllowed : boolean 

boolean isDeletingColumnsAllowed() / setDeletingColumnsAllowed(value)
Represents if the deletion of columns is allowed on a protected worksheet. The columns containing the cells to be deleted must be unlocked when the sheet is protected, and "Select unlocked cells" option must be enabled. NOTE: This member is now obsolete. Instead, please use Protection.AllowDeletingColumn property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowDeletingRow/setAllowDeletingRow : boolean 

boolean getAllowDeletingRow() / setAllowDeletingRow(value)
Represents if the deletion of rows is allowed on a protected worksheet. The rows containing the cells to be deleted must be unlocked when the sheet is protected, and "Select unlocked cells" option must be enabled.

isDeletingRowsAllowed/setDeletingRowsAllowed : boolean 

boolean isDeletingRowsAllowed() / setDeletingRowsAllowed(value)
Represents if the deletion of rows is allowed on a protected worksheet. The rows containing the cells to be deleted must be unlocked when the sheet is protected, and "Select unlocked cells" option must be enabled. NOTE: This member is now obsolete. Instead, please use Protection.AllowDeletingRow property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowFiltering/setAllowFiltering : boolean 

boolean getAllowFiltering() / setAllowFiltering(value)
Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.

isFilteringAllowed/setFilteringAllowed : boolean 

boolean isFilteringAllowed() / setFilteringAllowed(value)
Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected. NOTE: This member is now obsolete. Instead, please use Protection.AllowFiltering property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowFormattingCell/setAllowFormattingCell : boolean 

boolean getAllowFormattingCell() / setAllowFormattingCell(value)
Represents if the formatting of cells is allowed on a protected worksheet.

isFormattingCellsAllowed/setFormattingCellsAllowed : boolean 

boolean isFormattingCellsAllowed() / setFormattingCellsAllowed(value)
Represents if the formatting of cells is allowed on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowFormattingCell property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowFormattingColumn/setAllowFormattingColumn : boolean 

boolean getAllowFormattingColumn() / setAllowFormattingColumn(value)
Represents if the formatting of columns is allowed on a protected worksheet

isFormattingColumnsAllowed/setFormattingColumnsAllowed : boolean 

boolean isFormattingColumnsAllowed() / setFormattingColumnsAllowed(value)
Represents if the formatting of columns is allowed on a protected worksheet NOTE: This member is now obsolete. Instead, please use Protection.AllowFormattingColumn property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowFormattingRow/setAllowFormattingRow : boolean 

boolean getAllowFormattingRow() / setAllowFormattingRow(value)
Represents if the formatting of rows is allowed on a protected worksheet

isFormattingRowsAllowed/setFormattingRowsAllowed : boolean 

boolean isFormattingRowsAllowed() / setFormattingRowsAllowed(value)
Represents if the formatting of rows is allowed on a protected worksheet NOTE: This member is now obsolete. Instead, please use Protection.AllowFormattingRow property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowInsertingColumn/setAllowInsertingColumn : boolean 

boolean getAllowInsertingColumn() / setAllowInsertingColumn(value)
Represents if the insertion of columns is allowed on a protected worksheet

isInsertingColumnsAllowed/setInsertingColumnsAllowed : boolean 

boolean isInsertingColumnsAllowed() / setInsertingColumnsAllowed(value)
Represents if the insertion of columns is allowed on a protected worksheet NOTE: This member is now obsolete. Instead, please use Protection.AllowInsertingColumn property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowInsertingHyperlink/setAllowInsertingHyperlink : boolean 

boolean getAllowInsertingHyperlink() / setAllowInsertingHyperlink(value)
Represents if the insertion of hyperlinks is allowed on a protected worksheet

isInsertingHyperlinksAllowed/setInsertingHyperlinksAllowed : boolean 

boolean isInsertingHyperlinksAllowed() / setInsertingHyperlinksAllowed(value)
Represents if the insertion of hyperlinks is allowed on a protected worksheet NOTE: This member is now obsolete. Instead, please use Protection.AllowInsertingHyperlink property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowInsertingRow/setAllowInsertingRow : boolean 

boolean getAllowInsertingRow() / setAllowInsertingRow(value)
Represents if the insertion of rows is allowed on a protected worksheet

isInsertingRowsAllowed/setInsertingRowsAllowed : boolean 

boolean isInsertingRowsAllowed() / setInsertingRowsAllowed(value)
Represents if the insertion of rows is allowed on a protected worksheet NOTE: This member is now obsolete. Instead, please use Protection.AllowInsertingRow property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowSorting/setAllowSorting : boolean 

boolean getAllowSorting() / setAllowSorting(value)
Represents if the sorting option is allowed on a protected worksheet.

isSortingAllowed/setSortingAllowed : boolean 

boolean isSortingAllowed() / setSortingAllowed(value)
Represents if the sorting option is allowed on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowSorting property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowUsingPivotTable/setAllowUsingPivotTable : boolean 

boolean getAllowUsingPivotTable() / setAllowUsingPivotTable(value)
Represents if the user is allowed to manipulate pivot tables on a protected worksheet.

isUsingPivotTablesAllowed/setUsingPivotTablesAllowed : boolean 

boolean isUsingPivotTablesAllowed() / setUsingPivotTablesAllowed(value)
Represents if the user is allowed to manipulate pivot tables on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowUsingPivotTable property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowEditingContent/setAllowEditingContent : boolean 

boolean getAllowEditingContent() / setAllowEditingContent(value)
Represents if the user is allowed to edit contents of locked cells on a protected worksheet.

isEditingContentsAllowed/setEditingContentsAllowed : boolean 

boolean isEditingContentsAllowed() / setEditingContentsAllowed(value)
Represents if the user is allowed to edit contents of locked cells on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowEditingContent property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowEditingObject/setAllowEditingObject : boolean 

boolean getAllowEditingObject() / setAllowEditingObject(value)
Represents if the user is allowed to manipulate drawing objects on a protected worksheet.

isEditingObjectsAllowed/setEditingObjectsAllowed : boolean 

boolean isEditingObjectsAllowed() / setEditingObjectsAllowed(value)
Represents if the user is allowed to manipulate drawing objects on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowEditingObject property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowEditingScenario/setAllowEditingScenario : boolean 

boolean getAllowEditingScenario() / setAllowEditingScenario(value)
Represents if the user is allowed to edit scenarios on a protected worksheet.

isEditingScenariosAllowed/setEditingScenariosAllowed : boolean 

boolean isEditingScenariosAllowed() / setEditingScenariosAllowed(value)
Represents if the user is allowed to edit scenarios on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowEditingScenario property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getPassword/setPassword : String 

String getPassword() / setPassword(value)
Represents the password to protect the worksheet. If password is set to null or blank string, you can unprotect the worksheet or workbook without using a password. Otherwise, you must specify the password to unprotect the worksheet or workbook.

isProtectedWithPassword : boolean 

boolean isProtectedWithPassword()
Indicates whether the worksheets is protected with password.

getAllowSelectingLockedCell/setAllowSelectingLockedCell : boolean 

boolean getAllowSelectingLockedCell() / setAllowSelectingLockedCell(value)
Represents if the user is allowed to select locked cells on a protected worksheet.

isSelectingLockedCellsAllowed/setSelectingLockedCellsAllowed : boolean 

boolean isSelectingLockedCellsAllowed() / setSelectingLockedCellsAllowed(value)
Represents if the user is allowed to select locked cells on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowSelectingLockedCell property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

getAllowSelectingUnlockedCell/setAllowSelectingUnlockedCell : boolean 

boolean getAllowSelectingUnlockedCell() / setAllowSelectingUnlockedCell(value)
Represents if the user is allowed to select unlocked cells on a protected worksheet.

isSelectingUnlockedCellsAllowed/setSelectingUnlockedCellsAllowed : boolean 

boolean isSelectingUnlockedCellsAllowed() / setSelectingUnlockedCellsAllowed(value)
Represents if the user is allowed to select unlocked cells on a protected worksheet. NOTE: This member is now obsolete. Instead, please use Protection.AllowSelectingUnlockedCell property. This property will be removed 12 months later since June 2010. Aspose apologizes for any inconvenience you may have experienced.

Method Detail

copy

 copy(source)
Copy protection info.
Parameters:
source: Protection -

getPasswordHash

int getPasswordHash()
Gets the hash of current password.

verifyPassword

boolean verifyPassword(password)
Verifies password.
Parameters:
password: String - The password.
Returns:

See Also:
          Aspose.Cells Documentation - the home page for the Aspose.Cellss Product Documentation.
          Aspose.Cells Support Forum - our preferred method of support.