asposecells.api

Class Protection

Represents the various types of protection options available for a worksheet.

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()
method
           Represents if the deletion of columns is allowed on a protected worksheet.
methodgetAllowDeletingRow()
method
           Represents if the deletion of rows is allowed on a protected worksheet.
methodgetAllowEditingContent()
method
           Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
methodgetAllowEditingObject()
method
           Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
methodgetAllowEditingScenario()
method
           Represents if the user is allowed to edit scenarios on a protected worksheet.
methodgetAllowFiltering()
method
           Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
methodgetAllowFormattingCell()
method
           Represents if the formatting of cells is allowed on a protected worksheet.
methodgetAllowFormattingColumn()
method
           Represents if the formatting of columns is allowed on a protected worksheet
methodgetAllowFormattingRow()
method
           Represents if the formatting of rows is allowed on a protected worksheet
methodgetAllowInsertingColumn()
method
           Represents if the insertion of columns is allowed on a protected worksheet
methodgetAllowInsertingHyperlink()
method
           Represents if the insertion of hyperlinks is allowed on a protected worksheet
methodgetAllowInsertingRow()
method
           Represents if the insertion of rows is allowed on a protected worksheet
methodgetAllowSelectingLockedCell()
method
           Represents if the user is allowed to select locked cells on a protected worksheet.
methodgetAllowSelectingUnlockedCell()
method
           Represents if the user is allowed to select unlocked cells on a protected worksheet.
methodgetAllowSorting()
method
           Represents if the sorting option is allowed on a protected worksheet.
methodgetAllowUsingPivotTable()
method
           Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
methodisProtectedWithPassword()
Indicates whether the worksheets is protected with password.
methodgetPassword()
method
           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.
      • 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.
      • 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.
      • getAllowFormattingCell/setAllowFormattingCell : boolean 

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

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

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

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

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

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

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

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

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

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

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

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

        boolean getAllowSelectingUnlockedCell() / setAllowSelectingUnlockedCell(value)
        
        Represents if the user is allowed to select unlocked cells on a protected worksheet.
      • 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.
    • Method Detail

      • copy

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

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

        int getPasswordHash()
        Gets the hash of current password.