asposecells.api
Class Worksheet

Encapsulates the object that represents a single worksheet.

Example:

workbook = 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
methodgetActiveCell()
methodsetActiveCell(value)
           Gets or sets the active cell in the worksheet.
methodgetAllowEditRanges()
           Gets the allow edit range collection in the worksheet.
methodgetAutoFilter()
           Represents auto filter for the specified worksheet.
methodgetBackgroundImage()
methodsetBackgroundImage(value)
           Gets and sets worksheet background image.
methodgetCells()
           Gets the Cells collection.
methodgetCellWatches()
           Gets collection of cells on this worksheet being watched in the 'watch window'.
methodgetCharts()
           Gets a Chart collection
methodgetCheckBoxes()
           Gets a CheckBox collection.
methodgetCodeName()
methodsetCodeName(value)
           Gets worksheet code name.
methodgetComments()
           Gets the Comment collection.
methodgetConditionalFormattings()
           Gets the ConditionalFormattings in the worksheet.
methodgetCustomProperties()
           Gets an object representing the identifier information associated with a worksheet.
methodgetDisplayRightToLeft()
methodsetDisplayRightToLeft(value)
           Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false.
methodgetDisplayZeros()
methodsetDisplayZeros(value)
           True if zero values are displayed.
methodgetErrorCheckOptions()
           Gets error check setting applied on certain ranges.
methodgetFirstVisibleColumn()
methodsetFirstVisibleColumn(value)
           Represents first visible column index.
methodgetFirstVisibleRow()
methodsetFirstVisibleRow(value)
           Represents first visible row index.
methodhasAutofilter()
           Indicates whether this worksheet has auto filter.
methodgetHorizontalPageBreaks()
           Gets the HorizontalPageBreakCollection collection.
methodgetHyperlinks()
           Gets the HyperlinkCollection collection.
methodgetIndex()
           Gets the index of sheet in the worksheet collection.
methodisGridlinesVisible()
methodsetGridlinesVisible(value)
           Gets or sets a value indicating whether the gridelines are visible.Default is true.
methodisOutlineShown()
methodsetOutlineShown(value)
           Indicates whether to show outline.
methodisPageBreakPreview()
methodsetPageBreakPreview(value)
           Indicates whether the specified worksheet is shown in normal view or page break preview.
methodisProtected()
           Indicates if the worksheet is protected.
methodisRowColumnHeadersVisible()
methodsetRowColumnHeadersVisible(value)
           Gets or sets a value indicating whether the worksheet will display row and column headers. Default is true.
methodisRulerVisible()
methodsetRulerVisible(value)
           Indicates whether the ruler is visible. This property is only applied for page break preview.
methodisSelected()
methodsetSelected(value)
           Indicates whether this worksheet is selected when the workbook is opened.
methodisVisible()
methodsetVisible(value)
           Represents if the worksheet is visible.
methodgetListObjects()
           Gets all ListObjects in this worksheet.
methodgetName()
methodsetName(value)
           Gets or sets the name of the worksheet.
methodgetOleObjects()
           Represents a collection of OleObject in a worksheet.
methodgetOutline()
           Gets the outline on this worksheet.
methodgetPageSetup()
           Represents the page setup description in this sheet.
methodgetPictures()
           Gets a Picture collection.
methodgetPivotTables()
           Gets all pivot tables in this worksheet.
methodgetProtection()
           Represents the various types of protection options available for a worksheet. Supports advanced protection options in ExcelXP and above version.
methodgetQueryTables()
           Gets the queryTables in the worksheet.
methodgetScenarios()
           Gets the collection of Scenario.
methodgetShapes()
           Returns all drawing shapes in this worksheet.
methodgetShowFormulas()
methodsetShowFormulas(value)
           Indicates whether to show formulas or their results.
methodgetSlicers()
           Get the Slicer collection in the worksheet
methodgetSmartTagSetting()
           Gets all SmartTagCollection objects of the worksheet.
methodgetSparklineGroupCollection()
           Gets the sparkline group collection in the worksheet.
methodgetTabColor()
methodsetTabColor(value)
           Represents worksheet tab color.
methodgetTabId()
methodsetTabId(value)
           Specifies the internal identifier for the sheet.
methodgetTextBoxes()
           Gets a TextBox collection.
methodgetTransitionEntry()
methodsetTransitionEntry(value)
           Indicates whether the Transition Formula Entry (Lotus compatibility) option is enabled.
methodgetTransitionEvaluation()
methodsetTransitionEvaluation(value)
           Indicates whether the Transition Formula Evaluation (Lotus compatibility) option is enabled.
methodgetType()
methodsetType(value)
           Represents worksheet type. The value of the property is SheetType integer constant.
methodgetValidations()
           Gets the data validation setting collection in the worksheet.
methodgetVerticalPageBreaks()
           Gets the VerticalPageBreakCollection collection.
methodgetViewType()
methodsetViewType(value)
           Gets and sets the view type. The value of the property is ViewType integer constant.
methodgetVisibilityType()
methodsetVisibilityType(value)
           Indicates the visible state for this sheet. The value of the property is VisibilityType integer constant.
methodgetWorkbook()
           Gets the workbook object which contains this sheet.
methodgetZoom()
methodsetZoom(value)
           Represents the scaling factor in percentage. It should be between 10 and 400.
 
Method Summary
methodaddPageBreaks(cellName)
           Adds page break.
methodadvancedFilter(isFilter, listRange, criteriaRange, copyTo, uniqueRecordOnly)
           Filters data using complex criteria.
methodautoFitColumn(columnIndex)
           Autofits the column width.
methodautoFitColumn(columnIndex, firstRow, lastRow)
           Autofits the column width.
methodautoFitColumns()
           Autofits all columns in this worksheet.
methodautoFitColumns(options)
           Autofits all columns in this worksheet.
methodautoFitColumns(firstColumn, lastColumn)
           Autofits the columns width.
methodautoFitColumns(firstColumn, lastColumn, options)
           Autofits the columns width.
methodautoFitColumns(firstRow, firstColumn, lastRow, lastColumn)
           Autofits the columns width.
methodautoFitColumns(firstRow, firstColumn, lastRow, lastColumn, options)
           Autofits the columns width.
methodautoFitRow(rowIndex)
           Autofits the row height.
methodautoFitRow(rowIndex, firstColumn, lastColumn)
           Autofits the row height.
methodautoFitRow(rowIndex, firstColumn, lastColumn, options)
           Autofits the row height.
methodautoFitRow(startRow, endRow, startColumn, endColumn)
           Autofits row height in a rectangle range.
methodautoFitRows()
           Autofits all rows in this worksheet.
methodautoFitRows(onlyAuto)
           Autofits all rows in this worksheet.
methodautoFitRows(options)
           Autofits all rows in this worksheet.
methodautoFitRows(startRow, endRow)
           Autofits row height in a range.
methodautoFitRows(startRow, endRow, options)
           Autofits row height in a range.
methodcalculateFormula(recursive, ignoreError, customFunction)
           Calculates all formulas in this worksheet.
methodcalculateFormula(options, recursive)
           Calculates all formulas in this worksheet.
methodcalculateFormula(formula)
           Calculates a formula.
methodcalculateFormula(formula, opts)
           Calculates a formula.
methodclearComments()
           Clears all comments in designer spreadsheet.
methodcopy(sourceSheet)
           Copies contents and formats from another worksheet.
methodcopy(sourceSheet, copyOptions)
           Copies contents and formats from another worksheet.
methoddispose()
           Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
methodfreezePanes(row, column, freezedRows, freezedColumns)
           Freezes panes at the specified cell in the worksheet.
methodfreezePanes(cellName, freezedRows, freezedColumns)
           Freezes panes at the specified cell in the worksheet.
methodgetFreezedPanes()
           Gets the freeze panes.
methodgetPanes()
           Gets the window panes.
methodgetPrintingPageBreaks(options)
           Gets automatic page breaks.
methodgetSelectedRanges()
           Gets selected ranges of cells in the designer spreadsheet.
methodmoveTo(index)
           Moves the sheet to another location in the spreadsheet.
methodprotect(type)
           Protects worksheet.
methodprotect(type, password, oldPassword)
           Protects worksheet.
methodrefreshPivotTables()
           Refreshes all PivotTables in this Worksheet.
methodremoveAllDrawingObjects()
           Removes all drawing objects in this worksheet.
methodremoveAutoFilter()
           Removes the auto filter of the worksheet.
methodremoveSplit()
           Removes splitted window.
methodreplace(oldString, newString)
           Replaces all cells' text with a new string.
methodselectRange(startRow, startColumn, totalRows, totalColumns, removeOthers)
           Selects a range.
methodsetBackground(pictureData)
           Sets worksheet background image.
methodsetVisible(isVisible, ignoreError)
           Sets the visible options.
methodsplit()
           Splits window.
methodtoString()
           Returns a string represents the current Worksheet object.
methodunFreezePanes()
           Unfreezes panes in the worksheet.
methodunprotect()
           Unprotects worksheet.
methodunprotect(password)
           Unprotects worksheet.
methodxmlMapQuery(path, xmlMap)
           Query cell areas that mapped/linked to the specific path of xml map.
 

Property Getters/Setters Detail

getProtection : Protection 

Protection 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 

Workbook getWorkbook()
Gets the workbook object which contains this sheet.

getCells : Cells 

Cells getCells()
Gets the Cells collection.

getQueryTables : QueryTableCollection 

QueryTableCollection getQueryTables()
Gets the queryTables in the worksheet.

getPivotTables : PivotTableCollection 

PivotTableCollection getPivotTables()
Gets all pivot tables in this worksheet.

getType/setType : int 

int getType() / setType(value)
Represents worksheet type. The value of the property is SheetType integer constant.

getName/setName : String 

String getName() / 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 

boolean getShowFormulas() / setShowFormulas(value)
Indicates whether to show formulas or their results.

isGridlinesVisible/setGridlinesVisible : boolean 

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

isRowColumnHeadersVisible/setRowColumnHeadersVisible : boolean 

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

getDisplayZeros/setDisplayZeros : boolean 

boolean getDisplayZeros() / setDisplayZeros(value)
True if zero values are displayed.

getDisplayRightToLeft/setDisplayRightToLeft : boolean 

boolean getDisplayRightToLeft() / 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 

boolean isOutlineShown() / setOutlineShown(value)
Indicates whether to show outline.

isSelected/setSelected : boolean 

boolean isSelected() / setSelected(value)
Indicates whether this worksheet is selected when the workbook is opened.

getListObjects : ListObjectCollection 

ListObjectCollection getListObjects()
Gets all ListObjects in this worksheet.

getTabId/setTabId : int 

int getTabId() / setTabId(value)
Specifies the internal identifier for the sheet.

getHorizontalPageBreaks : HorizontalPageBreakCollection 

HorizontalPageBreakCollection getHorizontalPageBreaks()
Gets the HorizontalPageBreakCollection collection.

getVerticalPageBreaks : VerticalPageBreakCollection 

VerticalPageBreakCollection getVerticalPageBreaks()
Gets the VerticalPageBreakCollection collection.

getHyperlinks : HyperlinkCollection 

HyperlinkCollection getHyperlinks()
Gets the HyperlinkCollection collection.

getPageSetup : PageSetup 

PageSetup getPageSetup()
Represents the page setup description in this sheet.

getAutoFilter : AutoFilter 

AutoFilter getAutoFilter()
Represents auto filter for the specified worksheet.

hasAutofilter : boolean 

boolean hasAutofilter()
Indicates whether this worksheet has auto filter.

getTransitionEvaluation/setTransitionEvaluation : boolean 

boolean getTransitionEvaluation() / setTransitionEvaluation(value)
Indicates whether the Transition Formula Evaluation (Lotus compatibility) option is enabled.

getTransitionEntry/setTransitionEntry : boolean 

boolean getTransitionEntry() / setTransitionEntry(value)
Indicates whether the Transition Formula Entry (Lotus compatibility) option is enabled.

getVisibilityType/setVisibilityType : int 

int getVisibilityType() / setVisibilityType(value)
Indicates the visible state for this sheet. The value of the property is VisibilityType integer constant.

isVisible/setVisible : boolean 

boolean isVisible() / setVisible(value)
Represents if the worksheet is visible.

getSparklineGroupCollection : SparklineGroupCollection 

SparklineGroupCollection getSparklineGroupCollection()
Gets the sparkline group collection in the worksheet.

getCharts : ChartCollection 

ChartCollection getCharts()
Gets a Chart collection

getComments : CommentCollection 

CommentCollection getComments()
Gets the Comment collection.

getPictures : PictureCollection 

PictureCollection getPictures()
Gets a Picture collection.

getTextBoxes : TextBoxCollection 

TextBoxCollection getTextBoxes()
Gets a TextBox collection.

getCheckBoxes : CheckBoxCollection 

CheckBoxCollection getCheckBoxes()
Gets a CheckBox collection.

getOleObjects : OleObjectCollection 

OleObjectCollection getOleObjects()
Represents a collection of OleObject in a worksheet.

getShapes : ShapeCollection 

ShapeCollection getShapes()
Returns all drawing shapes in this worksheet.

getSlicers : SlicerCollection 

SlicerCollection getSlicers()
Get the Slicer collection in the worksheet

getIndex : int 

int getIndex()
Gets the index of sheet in the worksheet collection.

isProtected : boolean 

boolean isProtected()
Indicates if the worksheet is protected.

getValidations : ValidationCollection 

ValidationCollection getValidations()
Gets the data validation setting collection in the worksheet.

getAllowEditRanges : ProtectedRangeCollection 

ProtectedRangeCollection getAllowEditRanges()
Gets the allow edit range collection in the worksheet.

getErrorCheckOptions : ErrorCheckOptionCollection 

ErrorCheckOptionCollection getErrorCheckOptions()
Gets error check setting applied on certain ranges.

getOutline : Outline 

Outline getOutline()
Gets the outline on this worksheet.

getFirstVisibleRow/setFirstVisibleRow : int 

int getFirstVisibleRow() / setFirstVisibleRow(value)
Represents first visible row index.

getFirstVisibleColumn/setFirstVisibleColumn : int 

int getFirstVisibleColumn() / setFirstVisibleColumn(value)
Represents first visible column index.

getZoom/setZoom : int 

int getZoom() / setZoom(value)
Represents the scaling factor in percentage. It should be between 10 and 400. Please set the view type first.

getViewType/setViewType : int 

int getViewType() / setViewType(value)
Gets and sets the view type. The value of the property is ViewType integer constant.

isPageBreakPreview/setPageBreakPreview : boolean 

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

isRulerVisible/setRulerVisible : boolean 

boolean isRulerVisible() / setRulerVisible(value)
Indicates whether the ruler is visible. This property is only applied for page break preview.

getTabColor/setTabColor : Color 

Color getTabColor() / 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 

String getCodeName() / setCodeName(value)
Gets worksheet code name.

getBackgroundImage/setBackgroundImage : byte[] 

byte[] getBackgroundImage() / setBackgroundImage(value)
Gets and sets worksheet background image.

getConditionalFormattings : ConditionalFormattingCollection 

ConditionalFormattingCollection getConditionalFormattings()
Gets the ConditionalFormattings in the worksheet.

getActiveCell/setActiveCell : String 

String getActiveCell() / setActiveCell(value)
Gets or sets the active cell in the worksheet.

getCustomProperties : CustomPropertyCollection 

CustomPropertyCollection 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.

getSmartTagSetting : SmartTagSetting 

SmartTagSetting getSmartTagSetting()
Gets all SmartTagCollection objects of the worksheet.

getScenarios : ScenarioCollection 

ScenarioCollection getScenarios()
Gets the collection of Scenario.

getCellWatches : CellWatchCollection 

CellWatchCollection getCellWatches()
Gets collection of cells on this worksheet being watched in the 'watch window'.

Method Detail

replace

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

getSelectedRanges

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

setBackground

 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

CellArea[] 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

String toString()
Returns a string represents the current Worksheet object.
Returns:

calculateFormula

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

calculateFormula

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

calculateFormula

 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

 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

ArrayList 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

 refreshPivotTables()
Refreshes all PivotTables in this Worksheet.

dispose

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

getPanes

PaneCollection getPanes()
Gets the window panes. If the window is not splitted or frozen.

freezePanes

 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: int - Row index.
column: int - Column index.
freezedRows: int - Number of visible rows in top pane, no more than row index.
freezedColumns: int - Number of visible columns in left pane, no more than column index.

getFreezedPanes

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

split

 split()
Splits window.

freezePanes

 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: int - Number of visible rows in top pane, no more than row index.
freezedColumns: int - Number of visible columns in left pane, no more than column index.

unFreezePanes

 unFreezePanes()
Unfreezes panes in the worksheet.

removeSplit

 removeSplit()
Removes splitted window.

addPageBreaks

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

copy

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

copy

 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

 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: int - Column index.
firstRow: int - First row index.
lastRow: int - Last row index.

autoFitColumns

 autoFitColumns()
Autofits all columns in this worksheet.

autoFitColumns

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

autoFitColumn

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

autoFitColumns

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

autoFitColumns

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

autoFitColumns

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

autoFitColumns

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

autoFitRow

 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: int - Row index.
firstColumn: int - First column index.
lastColumn: int - Last column index.

autoFitRow

 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: int - Row index.
firstColumn: int - First column index.
lastColumn: int - Last column index.
options: AutoFitterOptions - The auto fitter options

autoFitRows

 autoFitRows()
Autofits all rows in this worksheet.

autoFitRows

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

autoFitRows

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

autoFitRows

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

autoFitRows

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

autoFitRow

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

autoFitRow

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

advancedFilter

 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

 removeAutoFilter()
Removes the auto filter of the worksheet.

setVisible

 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

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

removeAllDrawingObjects

 removeAllDrawingObjects()
Removes all drawing objects in this worksheet.

clearComments

 clearComments()
Clears all comments in designer spreadsheet.

protect

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

protect

 protect(type, password, oldPassword)
Protects worksheet. This method can protect worksheet in all versions of Excel file.
Parameters:
type: int - 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
excel = Workbook("Book2.xlsx")
# Accessing the first worksheet in the Excel file
worksheet = excel.getWorksheets().get(0)
# Protecting the worksheet with a password
worksheet.protect(ProtectionType.ALL, "aspose", None)
# Saving the modified Excel file in default (that is Excel 20003) format
excel.save("Book1.xls")

unprotect

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

unprotect

 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

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

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