aspose.cells

Class Worksheet

Encapsulates the object that represents a single worksheet.

Example:

$workbook = new cells\Workbook();
$sheet = $workbook->getWorksheets()->get(0);
//Freeze panes at "AS40" with 10 rows and 10 columns
$sheet->freezePanes("AS40", 10, 10);
//Add a hyperlink in Cell A1
$sheet->getHyperlinks()->add("A1", 1, 1, "http://www.aspose.com");

Property Getters/Setters Summary
functiongetActiveCell()
function
           Gets or sets the active cell in the worksheet.
functiongetAllowEditRanges()
Gets the allow edit range collection in the worksheet.
functiongetAutoFilter()
Represents auto filter for the specified worksheet.
functiongetBackgroundImage()
function
           Gets and sets worksheet background image.
functiongetCells()
Gets the Cells collection.
functiongetCellWatches()
Gets collection of cells on this worksheet being watched in the 'watch window'.
functiongetCharts()
Gets a Chart collection
functiongetCheckBoxes()
Gets a CheckBox collection.
functiongetCodeName()
function
           Gets worksheet code name.
functiongetComments()
Gets the Comment collection.
functiongetConditionalFormattings()
Gets the ConditionalFormattings in the worksheet.
functiongetCustomProperties()
Gets an object representing the identifier information associated with a worksheet.
functiongetDisplayRightToLeft()
function
           Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false.
functiongetDisplayZeros()
function
           True if zero values are displayed.
functiongetErrorCheckOptions()
Gets error check setting applied on certain ranges.
functiongetFirstVisibleColumn()
function
           Represents first visible column index.
functiongetFirstVisibleRow()
function
           Represents first visible row index.
functionhasAutofilter()
Indicates whether this worksheet has auto filter.
functiongetHorizontalPageBreaks()
Gets the HorizontalPageBreakCollection collection.
functiongetHyperlinks()
Gets the HyperlinkCollection collection.
functiongetIndex()
Gets the index of sheet in the worksheet collection.
functionisGridlinesVisible()
function
           Gets or sets a value indicating whether the gridelines are visible.Default is true.
functionisOutlineShown()
function
           Indicates whether to show outline.
functionisPageBreakPreview()
function
           Indicates whether the specified worksheet is shown in normal view or page break preview.
functionisProtected()
Indicates if the worksheet is protected.
functionisRowColumnHeadersVisible()
function
           Gets or sets a value indicating whether the worksheet will display row and column headers. Default is true.
functionisRulerVisible()
function
           Indicates whether the ruler is visible. This property is only applied for page break preview.
functionisSelected()
function
           Indicates whether this worksheet is selected when the workbook is opened.
functionisVisible()
function
setVisible(value)
           Represents if the worksheet is visible.
functiongetListObjects()
Gets all ListObjects in this worksheet.
functiongetName()
function
setName(value)
           Gets or sets the name of the worksheet.
functiongetOleObjects()
Represents a collection of OleObject in a worksheet.
functiongetOutline()
Gets the outline on this worksheet.
functiongetPageSetup()
Represents the page setup description in this sheet.
functiongetPictures()
Gets a Picture collection.
functiongetPivotTables()
Gets all pivot tables in this worksheet.
functiongetProtection()
Represents the various types of protection options available for a worksheet. Supports advanced protection options in ExcelXP and above version.
functiongetQueryTables()
Gets the queryTables in the worksheet.
functiongetScenarios()
Gets the collection of Scenario.
functiongetShapes()
Returns all drawing shapes in this worksheet.
functiongetShowFormulas()
function
           Indicates whether to show formulas or their results.
functiongetSlicers()
Get the Slicer collection in the worksheet
functiongetSmartTagSetting()
Gets all SmartTagCollection objects of the worksheet.
functiongetSparklineGroupCollection()
Gets the sparkline group collection in the worksheet.
functiongetTabColor()
function
           Represents worksheet tab color.
functiongetTabId()
function
setTabId(value)
           Specifies the internal identifier for the sheet.
functiongetTextBoxes()
Gets a TextBox collection.
functiongetTransitionEntry()
function
           Indicates whether the Transition Formula Entry (Lotus compatibility) option is enabled.
functiongetTransitionEvaluation()
function
           Indicates whether the Transition Formula Evaluation (Lotus compatibility) option is enabled.
functiongetType()
function
setType(value)
           Represents worksheet type. The value of the property is SheetType integer constant.
functiongetValidations()
Gets the data validation setting collection in the worksheet.
functiongetVerticalPageBreaks()
Gets the VerticalPageBreakCollection collection.
functiongetViewType()
function
           Gets and sets the view type. The value of the property is ViewType integer constant.
functiongetVisibilityType()
function
           Indicates the visible state for this sheet. The value of the property is VisibilityType integer constant.
functiongetWorkbook()
Gets the workbook object which contains this sheet.
functiongetZoom()
function
setZoom(value)
           Represents the scaling factor in percentage. It should be between 10 and 400.
 
Method Summary
functionaddPageBreaks(cellName)
Adds page break.
functionadvancedFilter(isFilter, listRange, criteriaRange, copyTo, uniqueRecordOnly)
Filters data using complex criteria.
functionautoFitColumn(columnIndex)
Autofits the column width.
functionautoFitColumn(columnIndex, firstRow, lastRow)
Autofits the column width.
functionautoFitColumns()
Autofits all columns in this worksheet.
functionautoFitColumns(options)
Autofits all columns in this worksheet.
functionautoFitColumns(firstColumn, lastColumn)
Autofits the columns width.
functionautoFitColumns(firstColumn, lastColumn, options)
Autofits the columns width.
functionautoFitColumns(firstRow, firstColumn, lastRow, lastColumn)
Autofits the columns width.
functionautoFitColumns(firstRow, firstColumn, lastRow, lastColumn, options)
Autofits the columns width.
functionautoFitRow(rowIndex)
Autofits the row height.
functionautoFitRow(rowIndex, firstColumn, lastColumn)
Autofits the row height.
functionautoFitRow(rowIndex, firstColumn, lastColumn, options)
Autofits the row height.
functionautoFitRow(startRow, endRow, startColumn, endColumn)
Autofits row height in a rectangle range.
functionautoFitRows()
Autofits all rows in this worksheet.
functionautoFitRows(onlyAuto)
Autofits all rows in this worksheet.
functionautoFitRows(options)
Autofits all rows in this worksheet.
functionautoFitRows(startRow, endRow)
Autofits row height in a range.
functionautoFitRows(startRow, endRow, options)
Autofits row height in a range.
functioncalculateFormula(recursive, ignoreError, customFunction)
Calculates all formulas in this worksheet.
functioncalculateFormula(options, recursive)
Calculates all formulas in this worksheet.
functioncalculateFormula(formula)
Calculates a formula.
functioncalculateFormula(formula, opts)
Calculates a formula.
functionclearComments()
Clears all comments in designer spreadsheet.
functioncopy(sourceSheet)
Copies contents and formats from another worksheet.
functioncopy(sourceSheet, copyOptions)
Copies contents and formats from another worksheet.
functiondispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
functionfreezePanes(row, column, freezedRows, freezedColumns)
Freezes panes at the specified cell in the worksheet.
functionfreezePanes(cellName, freezedRows, freezedColumns)
Freezes panes at the specified cell in the worksheet.
functiongetFreezedPanes()
Gets the freeze panes.
functiongetPanes()
Gets the window panes.
functiongetPrintingPageBreaks(options)
Gets automatic page breaks.
functiongetSelectedRanges()
Gets selected ranges of cells in the designer spreadsheet.
functionmoveTo(index)
Moves the sheet to another location in the spreadsheet.
functionprotect(type)
Protects worksheet.
functionprotect(type, password, oldPassword)
Protects worksheet.
functionrefreshPivotTables()
Refreshes all PivotTables in this Worksheet.
functionremoveAllDrawingObjects()
Removes all drawing objects in this worksheet.
functionremoveAutoFilter()
Removes the auto filter of the worksheet.
functionremoveSplit()
Removes splitted window.
functionreplace(oldString, newString)
Replaces all cells' text with a new string.
functionselectRange(startRow, startColumn, totalRows, totalColumns, removeOthers)
Selects a range.
functionsetBackground(pictureData)
Sets worksheet background image.
functionsetVisible(isVisible, ignoreError)
Sets the visible options.
functionsplit()
Splits window.
functiontoString()
Returns a string represents the current Worksheet object.
functionunFreezePanes()
Unfreezes panes in the worksheet.
functionunprotect()
Unprotects worksheet.
functionunprotect(password)
Unprotects worksheet.
functionxmlMapQuery(path, xmlMap)
Query cell areas that mapped/linked to the specific path of xml map.
 

    • Property Getters/Setters Detail

      • getProtection : Protection 

        function getProtection()
        
        Represents the various types of protection options available for a worksheet. Supports advanced protection options in ExcelXP and above version. This property can protect worksheet in all versions of Excel file and support advanced protection options in ExcelXP and above version.
      • getWorkbook : Workbook 

        function getWorkbook()
        
        Gets the workbook object which contains this sheet.
      • getCells : Cells 

        function getCells()
        
        Gets the Cells collection.
      • getQueryTables : QueryTableCollection 

        function getQueryTables()
        
        Gets the queryTables in the worksheet.
      • getPivotTables : PivotTableCollection 

        function getPivotTables()
        
        Gets all pivot tables in this worksheet.
      • getType/setType : Number 

        function getType() / function setType(value)
        
        Represents worksheet type. The value of the property is SheetType integer constant.
      • getName/setName : String 

        function getName() / function setName(value)
        
        Gets or sets the name of the worksheet. The max length of sheet name is 31. And you cannot assign same name(case insensitive) to two worksheets. For example, you cannot set "SheetName1" to the first worksheet and set "SHEETNAME1" to the second worksheet.
      • getShowFormulas/setShowFormulas : boolean 

        function getShowFormulas() / function setShowFormulas(value)
        
        Indicates whether to show formulas or their results.
      • isGridlinesVisible/setGridlinesVisible : boolean 

        function isGridlinesVisible() / function setGridlinesVisible(value)
        
        Gets or sets a value indicating whether the gridelines are visible.Default is true.
      • isRowColumnHeadersVisible/setRowColumnHeadersVisible : boolean 

        function isRowColumnHeadersVisible() / function setRowColumnHeadersVisible(value)
        
        Gets or sets a value indicating whether the worksheet will display row and column headers. Default is true.
      • getDisplayZeros/setDisplayZeros : boolean 

        function getDisplayZeros() / function setDisplayZeros(value)
        
        True if zero values are displayed.
      • getDisplayRightToLeft/setDisplayRightToLeft : boolean 

        function getDisplayRightToLeft() / function setDisplayRightToLeft(value)
        
        Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false.
      • isOutlineShown/setOutlineShown : boolean 

        function isOutlineShown() / function setOutlineShown(value)
        
        Indicates whether to show outline.
      • isSelected/setSelected : boolean 

        function isSelected() / function setSelected(value)
        
        Indicates whether this worksheet is selected when the workbook is opened.
      • getListObjects : ListObjectCollection 

        function getListObjects()
        
        Gets all ListObjects in this worksheet.
      • getTabId/setTabId : Number 

        function getTabId() / function setTabId(value)
        
        Specifies the internal identifier for the sheet.
      • getPageSetup : PageSetup 

        function getPageSetup()
        
        Represents the page setup description in this sheet.
      • getAutoFilter : AutoFilter 

        function getAutoFilter()
        
        Represents auto filter for the specified worksheet.
      • hasAutofilter : boolean 

        function hasAutofilter()
        
        Indicates whether this worksheet has auto filter.
      • getTransitionEvaluation/setTransitionEvaluation : boolean 

        function getTransitionEvaluation() / function setTransitionEvaluation(value)
        
        Indicates whether the Transition Formula Evaluation (Lotus compatibility) option is enabled.
      • getTransitionEntry/setTransitionEntry : boolean 

        function getTransitionEntry() / function setTransitionEntry(value)
        
        Indicates whether the Transition Formula Entry (Lotus compatibility) option is enabled.
      • getVisibilityType/setVisibilityType : Number 

        function getVisibilityType() / function setVisibilityType(value)
        
        Indicates the visible state for this sheet. The value of the property is VisibilityType integer constant.
      • isVisible/setVisible : boolean 

        function isVisible() / function setVisible(value)
        
        Represents if the worksheet is visible.
      • getSparklineGroupCollection : SparklineGroupCollection 

        function getSparklineGroupCollection()
        
        Gets the sparkline group collection in the worksheet.
      • getShapes : ShapeCollection 

        function getShapes()
        
        Returns all drawing shapes in this worksheet.
      • getSlicers : SlicerCollection 

        function getSlicers()
        
        Get the Slicer collection in the worksheet
      • getIndex : Number 

        function getIndex()
        
        Gets the index of sheet in the worksheet collection.
      • isProtected : boolean 

        function isProtected()
        
        Indicates if the worksheet is protected.
      • getValidations : ValidationCollection 

        function getValidations()
        
        Gets the data validation setting collection in the worksheet.
      • getAllowEditRanges : ProtectedRangeCollection 

        function getAllowEditRanges()
        
        Gets the allow edit range collection in the worksheet.
      • getErrorCheckOptions : ErrorCheckOptionCollection 

        function getErrorCheckOptions()
        
        Gets error check setting applied on certain ranges.
      • getOutline : Outline 

        function getOutline()
        
        Gets the outline on this worksheet.
      • getFirstVisibleRow/setFirstVisibleRow : Number 

        function getFirstVisibleRow() / function setFirstVisibleRow(value)
        
        Represents first visible row index.
      • getFirstVisibleColumn/setFirstVisibleColumn : Number 

        function getFirstVisibleColumn() / function setFirstVisibleColumn(value)
        
        Represents first visible column index.
      • getZoom/setZoom : Number 

        function getZoom() / function setZoom(value)
        
        Represents the scaling factor in percentage. It should be between 10 and 400. Please set the view type first.
      • getViewType/setViewType : Number 

        function getViewType() / function setViewType(value)
        
        Gets and sets the view type. The value of the property is ViewType integer constant.
      • isPageBreakPreview/setPageBreakPreview : boolean 

        function isPageBreakPreview() / function setPageBreakPreview(value)
        
        Indicates whether the specified worksheet is shown in normal view or page break preview.
      • isRulerVisible/setRulerVisible : boolean 

        function isRulerVisible() / function setRulerVisible(value)
        
        Indicates whether the ruler is visible. This property is only applied for page break preview.
      • getTabColor/setTabColor : Color 

        function getTabColor() / function setTabColor(value)
        
        Represents worksheet tab color. This feature is only supported in ExcelXP(Excel2002) and later versions. If you save file as Excel97 or Excel2000 format, it will be omitted.
      • getCodeName/setCodeName : String 

        function getCodeName() / function setCodeName(value)
        
        Gets worksheet code name.
      • getBackgroundImage/setBackgroundImage : byte[] 

        function getBackgroundImage() / function setBackgroundImage(value)
        
        Gets and sets worksheet background image.
      • getActiveCell/setActiveCell : String 

        function getActiveCell() / function setActiveCell(value)
        
        Gets or sets the active cell in the worksheet.
      • getCustomProperties : CustomPropertyCollection 

        function getCustomProperties()
        
        Gets an object representing the identifier information associated with a worksheet. Worksheet.CustomProperties provide a preferred mechanism for storing arbitrary data. It supports legacy third-party document components, as well as those situations that have a stringent need for binary parts.
      • getCellWatches : CellWatchCollection 

        function getCellWatches()
        
        Gets collection of cells on this worksheet being watched in the 'watch window'.
    • Method Detail

      • replace

        function replace(oldString, newString)
        Replaces all cells' text with a new string.
        Parameters:
        oldString: String - Old string value.
        newString: String - New string value.
      • getSelectedRanges

        function getSelectedRanges()
        Gets selected ranges of cells in the designer spreadsheet.
        Returns:
        An java.util.ArrayList which contains selected ranges.
      • setBackground

        function setBackground(pictureData)
        Sets worksheet background image. NOTE: This member is now obsolete. Instead, please use Worksheet.BackgroundImage property. This property will be removed 12 months later since August 2016. Aspose apologizes for any inconvenience you may have experienced.
        Parameters:
        pictureData: byte[] - Picture data.
      • getPrintingPageBreaks

        function getPrintingPageBreaks(options)
        Gets automatic page breaks. Each cell area represents a paper.
        Parameters:
        options: ImageOrPrintOptions - The print options
        Returns:
        The automatic page breaks areas.
      • toString

        function toString()
        Returns a string represents the current Worksheet object.
        Returns:
      • calculateFormula

        function calculateFormula(formula)
        Calculates a formula.
        Parameters:
        formula: String - Formula to be calculated.
        Returns:
        Calculated formula result.
      • calculateFormula

        function calculateFormula(formula, opts)
        Calculates a formula.
        Parameters:
        formula: String - Formula to be calculated.
        opts: CalculationOptions - Options for calculating formula
        Returns:
        Calculated formula result.
      • calculateFormula

        function calculateFormula(recursive, ignoreError, customFunction)
        Calculates all formulas in this worksheet.
        Parameters:
        recursive: boolean - True means if the worksheet' cells depend on the cells of other worksheets, the dependant cells in other worksheets will be calculated too. False means all the formulas in the worksheet have been calculated and the values are right.
        ignoreError: boolean - Indicates if hide the error in calculating formulas. The error may be unsupported function, external links, etc.
        customFunction: ICustomFunction - The custom formula calculation functions to extend the calculation engine.
      • calculateFormula

        function calculateFormula(options, recursive)
        Calculates all formulas in this worksheet.
        Parameters:
        options: CalculationOptions - Options for calculation
        recursive: boolean - True means if the worksheet' cells depend on the cells of other worksheets, the dependant cells in other worksheets will be calculated too. False means all the formulas in the worksheet have been calculated and the values are right.
      • xmlMapQuery

        function xmlMapQuery(path, xmlMap)
        Query cell areas that mapped/linked to the specific path of xml map. e.g. A xml map element structure: -RootElement |-Attribute1 |-SubElement |-Attribute2 |-Attribute3 To query "Attribute1", path is "/RootElement/@Attribute1" To query "Attribute2", path is "/RootElement/SubElement/@Attribute2" To query whole "SubElement", path is "/RootElement/SubElement"
        Parameters:
        path: String - xml element path
        xmlMap: XmlMap - Specify an xml map if you want to query for the specific path within a specific map
        Returns:
        CellArea list that mapped/linked to the specific path of xml map, an empty list is returned if nothing is mapped/linked.
      • refreshPivotTables

        function refreshPivotTables()
        Refreshes all PivotTables in this Worksheet.
      • dispose

        function dispose()
        Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
      • getPanes

        function getPanes()
        Gets the window panes. If the window is not splitted or frozen.
      • freezePanes

        function freezePanes(row, column, freezedRows, freezedColumns)
        Freezes panes at the specified cell in the worksheet.

        Row index and column index cannot all be zero. Number of rows and number of columns also cannot all be zero.

        The first two parameters specify the freezed position and the last two parameters specify the area freezed on the left top pane.

        Parameters:
        row: Number - Row index.
        column: Number - Column index.
        freezedRows: Number - Number of visible rows in top pane, no more than row index.
        freezedColumns: Number - Number of visible columns in left pane, no more than column index.
      • getFreezedPanes

        function getFreezedPanes()
        Gets the freeze panes.
        Returns:
        Return null means the worksheet is not frozen 0:Row index;1:column;2:freezedRows;3:freezedRows
      • split

        function split()
        Splits window.
      • freezePanes

        function freezePanes(cellName, freezedRows, freezedColumns)
        Freezes panes at the specified cell in the worksheet. Row index and column index cannot all be zero. Number of rows and number of columns also cannot all be zero.
        Parameters:
        cellName: String - Cell name.
        freezedRows: Number - Number of visible rows in top pane, no more than row index.
        freezedColumns: Number - Number of visible columns in left pane, no more than column index.
      • unFreezePanes

        function unFreezePanes()
        Unfreezes panes in the worksheet.
      • removeSplit

        function removeSplit()
        Removes splitted window.
      • addPageBreaks

        function addPageBreaks(cellName)
        Adds page break.
        Parameters:
        cellName: String -
      • copy

        function copy(sourceSheet)
        Copies contents and formats from another worksheet.
        Parameters:
        sourceSheet: Worksheet - Source worksheet.
      • copy

        function copy(sourceSheet, copyOptions)
        Copies contents and formats from another worksheet. You can copy data from another worksheet in the same file or another file. However, this method does not support to copy drawing objects, such as comments, images and charts.
        Parameters:
        sourceSheet: Worksheet - Source worksheet.
        copyOptions: CopyOptions -
      • autoFitColumn

        function autoFitColumn(columnIndex, firstRow, lastRow)
        Autofits the column width. This method autofits a row based on content in a range of cells within the row.
        Parameters:
        columnIndex: Number - Column index.
        firstRow: Number - First row index.
        lastRow: Number - Last row index.
      • autoFitColumns

        function autoFitColumns()
        Autofits all columns in this worksheet.
      • autoFitColumns

        function autoFitColumns(options)
        Autofits all columns in this worksheet.
        Parameters:
        options: AutoFitterOptions - The auto fitting options
      • autoFitColumn

        function autoFitColumn(columnIndex)
        Autofits the column width. AutoFitColumn is an imprecise function.
        Parameters:
        columnIndex: Number - Column index.
      • autoFitColumns

        function autoFitColumns(firstColumn, lastColumn)
        Autofits the columns width. AutoFitColumn is an imprecise function.
        Parameters:
        firstColumn: Number - First column index.
        lastColumn: Number - Last column index.
      • autoFitColumns

        function autoFitColumns(firstColumn, lastColumn, options)
        Autofits the columns width. AutoFitColumn is an imprecise function.
        Parameters:
        firstColumn: Number - First column index.
        lastColumn: Number - Last column index.
        options: AutoFitterOptions - The auto fitting options
      • autoFitColumns

        function autoFitColumns(firstRow, firstColumn, lastRow, lastColumn)
        Autofits the columns width. AutoFitColumn is an imprecise function.
        Parameters:
        firstRow: Number - First row index.
        firstColumn: Number - First column index.
        lastRow: Number - Last row index.
        lastColumn: Number - Last column index.
      • autoFitColumns

        function autoFitColumns(firstRow, firstColumn, lastRow, lastColumn, options)
        Autofits the columns width. AutoFitColumn is an imprecise function.
        Parameters:
        firstRow: Number - First row index.
        firstColumn: Number - First column index.
        lastRow: Number - Last row index.
        lastColumn: Number - Last column index.
        options: AutoFitterOptions - The auto fitting options
      • autoFitRow

        function autoFitRow(rowIndex, firstColumn, lastColumn)
        Autofits the row height. This method autofits a row based on content in a range of cells within the row.
        Parameters:
        rowIndex: Number - Row index.
        firstColumn: Number - First column index.
        lastColumn: Number - Last column index.
      • autoFitRow

        function autoFitRow(rowIndex, firstColumn, lastColumn, options)
        Autofits the row height. This method autofits a row based on content in a range of cells within the row.
        Parameters:
        rowIndex: Number - Row index.
        firstColumn: Number - First column index.
        lastColumn: Number - Last column index.
        options: AutoFitterOptions - The auto fitter options
      • autoFitRows

        function autoFitRows()
        Autofits all rows in this worksheet.
      • autoFitRows

        function autoFitRows(onlyAuto)
        Autofits all rows in this worksheet.
        Parameters:
        onlyAuto: boolean - True,only autofits the row height when row height is not customed.
      • autoFitRows

        function autoFitRows(options)
        Autofits all rows in this worksheet.
        Parameters:
        options: AutoFitterOptions - The auto fitter options
      • autoFitRows

        function autoFitRows(startRow, endRow)
        Autofits row height in a range.
        Parameters:
        startRow: Number - Start row index.
        endRow: Number - End row index.
      • autoFitRows

        function autoFitRows(startRow, endRow, options)
        Autofits row height in a range.
        Parameters:
        startRow: Number - Start row index.
        endRow: Number - End row index.
        options: AutoFitterOptions - The options of auto fitter.
      • autoFitRow

        function autoFitRow(startRow, endRow, startColumn, endColumn)
        Autofits row height in a rectangle range.
        Parameters:
        startRow: Number - Start row index.
        endRow: Number - End row index.
        startColumn: Number - Start column index.
        endColumn: Number - End column index.
      • autoFitRow

        function autoFitRow(rowIndex)
        Autofits the row height. AutoFitRow is an imprecise function.
        Parameters:
        rowIndex: Number - Row index.
      • advancedFilter

        function advancedFilter(isFilter, listRange, criteriaRange, copyTo, uniqueRecordOnly)
        Filters data using complex criteria.
        Parameters:
        isFilter: boolean - Inidicates whether filtering the list in place.
        listRange: String - The list range.
        criteriaRange: String - The criteria range.
        copyTo: String - The range where copying data to.
        uniqueRecordOnly: boolean - Only displaying or copying unique rows.
      • removeAutoFilter

        function removeAutoFilter()
        Removes the auto filter of the worksheet.
      • setVisible

        function setVisible(isVisible, ignoreError)
        Sets the visible options.
        Parameters:
        isVisible: boolean - Whether the worksheet is visible
        ignoreError: boolean - Whether to ignore error if this option is not valid.
      • selectRange

        function selectRange(startRow, startColumn, totalRows, totalColumns, removeOthers)
        Selects a range.
        Parameters:
        startRow: Number - The start row.
        startColumn: Number - The start column
        totalRows: Number - The number of rows.
        totalColumns: Number - The number of columns
        removeOthers: boolean - True means removing other selected range and only select this range.
      • removeAllDrawingObjects

        function removeAllDrawingObjects()
        Removes all drawing objects in this worksheet.
      • clearComments

        function clearComments()
        Clears all comments in designer spreadsheet.
      • protect

        function protect(type)
        Protects worksheet. This method protects worksheet without password. It can protect worksheet in all versions of Excel file.
        Parameters:
        type: Number - A ProtectionType value. Protection type.
      • protect

        function protect(type, password, oldPassword)
        Protects worksheet. This method can protect worksheet in all versions of Excel file.
        Parameters:
        type: Number - A ProtectionType value. Protection type.
        password: String - Password.
        oldPassword: String - If the worksheet is already protected by a password, please supply the old password. Otherwise, you can set a null value or blank string to this parameter.

        Example:

        //Instantiating a Workbook object
        $workbook = new cells\Workbook("Book1.xls");
        //Accessing the first worksheet in the Excel file
        $worksheet = $workbook->getWorksheets()->get(0);
        //Protecting the worksheet with a password
        $worksheet->protect(cells\ProtectionType::ALL, "aspose", null);
      • unprotect

        function unprotect()
        Unprotects worksheet. This method unprotects worksheet which is protected without password.
      • unprotect

        function unprotect(password)
        Unprotects worksheet. If the worksheet is protected without a password, you can set a null value or blank string to password parameter.
        Parameters:
        password: String - Password
      • moveTo

        function moveTo(index)
        Moves the sheet to another location in the spreadsheet.
        Parameters:
        index: Number - Destination sheet index.