aspose.cells

Class Protection

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

Example:

//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
functiongetAllowDeletingColumn()
function
           Represents if the deletion of columns is allowed on a protected worksheet.
functiongetAllowDeletingRow()
function
           Represents if the deletion of rows is allowed on a protected worksheet.
functiongetAllowEditingContent()
function
           Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
functiongetAllowEditingObject()
function
           Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
functiongetAllowEditingScenario()
function
           Represents if the user is allowed to edit scenarios on a protected worksheet.
functiongetAllowFiltering()
function
           Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
functiongetAllowFormattingCell()
function
           Represents if the formatting of cells is allowed on a protected worksheet.
functiongetAllowFormattingColumn()
function
           Represents if the formatting of columns is allowed on a protected worksheet
functiongetAllowFormattingRow()
function
           Represents if the formatting of rows is allowed on a protected worksheet
functiongetAllowInsertingColumn()
function
           Represents if the insertion of columns is allowed on a protected worksheet
functiongetAllowInsertingHyperlink()
function
           Represents if the insertion of hyperlinks is allowed on a protected worksheet
functiongetAllowInsertingRow()
function
           Represents if the insertion of rows is allowed on a protected worksheet
functiongetAllowSelectingLockedCell()
function
           Represents if the user is allowed to select locked cells on a protected worksheet.
functiongetAllowSelectingUnlockedCell()
function
           Represents if the user is allowed to select unlocked cells on a protected worksheet.
functiongetAllowSorting()
function
           Represents if the sorting option is allowed on a protected worksheet.
functiongetAllowUsingPivotTable()
function
           Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
functionisDeletingColumnsAllowed()
function
           Represents if the deletion of columns is allowed on a protected worksheet.
functionisDeletingRowsAllowed()
function
           Represents if the deletion of rows is allowed on a protected worksheet.
functionisEditingContentsAllowed()
function
           Represents if the user is allowed to edit contents of locked cells on a protected worksheet.
functionisEditingObjectsAllowed()
function
           Represents if the user is allowed to manipulate drawing objects on a protected worksheet.
functionisEditingScenariosAllowed()
function
           Represents if the user is allowed to edit scenarios on a protected worksheet.
functionisFilteringAllowed()
function
           Represents if the user is allowed to make use of an AutoFilter that was created before the sheet was protected.
functionisFormattingCellsAllowed()
function
           Represents if the formatting of cells is allowed on a protected worksheet.
functionisFormattingColumnsAllowed()
function
           Represents if the formatting of columns is allowed on a protected worksheet
functionisFormattingRowsAllowed()
function
           Represents if the formatting of rows is allowed on a protected worksheet
functionisInsertingColumnsAllowed()
function
           Represents if the insertion of columns is allowed on a protected worksheet
functionisInsertingHyperlinksAllowed()
function
           Represents if the insertion of hyperlinks is allowed on a protected worksheet
functionisInsertingRowsAllowed()
function
           Represents if the insertion of rows is allowed on a protected worksheet
functionisProtectedWithPassword()
Indicates whether the worksheets is protected with password.
functionisSelectingLockedCellsAllowed()
function
           Represents if the user is allowed to select locked cells on a protected worksheet.
functionisSelectingUnlockedCellsAllowed()
function
           Represents if the user is allowed to select unlocked cells on a protected worksheet.
functionisSortingAllowed()
function
           Represents if the sorting option is allowed on a protected worksheet.
functionisUsingPivotTablesAllowed()
function
           Represents if the user is allowed to manipulate pivot tables on a protected worksheet.
functiongetPassword()
function
           Represents the password to protect the worksheet.
 
Method Summary
functioncopy(source)
Copy protection info.
functiongetPasswordHash()
Gets the hash of current password.
functionverifyPassword(password)
Verifies password.
 

    • Property Getters/Setters Detail

      • getAllowDeletingColumn/setAllowDeletingColumn : boolean 

        function getAllowDeletingColumn() / function 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 

        function isDeletingColumnsAllowed() / function 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 

        function getAllowDeletingRow() / function 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 

        function isDeletingRowsAllowed() / function 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 

        function getAllowFiltering() / function 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 

        function isFilteringAllowed() / function 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 

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

        function isFormattingCellsAllowed() / function 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 

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

        function isFormattingColumnsAllowed() / function 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 

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

        function isFormattingRowsAllowed() / function 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 

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

        function isInsertingColumnsAllowed() / function 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 

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

        function isInsertingHyperlinksAllowed() / function 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 

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

        function isInsertingRowsAllowed() / function 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 

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

        function isSortingAllowed() / function 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 

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

        function isUsingPivotTablesAllowed() / function 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 

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

        function isEditingContentsAllowed() / function 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 

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

        function isEditingObjectsAllowed() / function 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 

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

        function isEditingScenariosAllowed() / function 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 

        function getPassword() / function 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 

        function isProtectedWithPassword()
        
        Indicates whether the worksheets is protected with password.
      • getAllowSelectingLockedCell/setAllowSelectingLockedCell : boolean 

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

        function isSelectingLockedCellsAllowed() / function 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 

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

        function isSelectingUnlockedCellsAllowed() / function 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

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

        function getPasswordHash()
        Gets the hash of current password.
      • verifyPassword

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