Worksheet

Worksheet class

Encapsulates the object that represents a single worksheet.

Properties

NameTypeDescription
ProtectionProtectionRepresents the various types of protection options available for a worksheet. Supports advanced protection options in Ex
UniqueIdStringGets and sets the unique id, it is same as {15DB5C3C-A5A1-48AF-8F25-3D86AC232D4F}.
WorkbookWorkbookGets the workbook object which contains this sheet.
CellsCellsGets the Cells collection.
QueryTablesQueryTableCollectionGets QueryTableCollection in the worksheet.
TypeintRepresents worksheet type. The value of the property is SheetType integer constant.
NameStringGets or sets the name of the worksheet. The max length of sheet name is 31. And you cannot assign same name(case insensi
ShowFormulasbooleanIndicates whether to show formulas or their results.
ShowDataTypeIconsboolean
IsGridlinesVisiblebooleanGets or sets a value indicating whether the gridlines are visible.Default is true.
IsRowColumnHeadersVisiblebooleanGets or sets a value indicating whether the worksheet will display row and column headers. Default is true.
PaneStateintIndicates whether the pane has horizontal or vertical splits, and whether those splits are frozen. The value of the prop
DisplayZerosbooleanTrue if zero values are displayed.
DisplayRightToLeftbooleanIndicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false.
IsOutlineShownbooleanIndicates whether to show outline.
IsSelectedbooleanIndicates whether this worksheet is selected when the workbook is opened.
PivotTablesPivotTableCollectionGets all pivot tables in this worksheet.
ListObjectsListObjectCollectionGets all ListObjects in this worksheet.
TabIdintSpecifies the internal identifier for the sheet.
HorizontalPageBreaksHorizontalPageBreakCollectionGets the HorizontalPageBreakCollection collection.
VerticalPageBreaksVerticalPageBreakCollectionGets the VerticalPageBreakCollection collection.
HyperlinksHyperlinkCollectionGets the HyperlinkCollection collection.
PageSetupPageSetupRepresents the page setup description in this sheet.
AutoFilterAutoFilterRepresents auto filter for the specified worksheet.
HasAutofilterbooleanIndicates whether this worksheet has auto filter.
TransitionEvaluationbooleanIndicates whether the Transition Formula Evaluation (Lotus compatibility) option is enabled.
TransitionEntrybooleanIndicates whether the Transition Formula Entry (Lotus compatibility) option is enabled.
VisibilityTypeintIndicates the visible state for this sheet. The value of the property is VisibilityType integer constant.
IsVisiblebooleanRepresents if the worksheet is visible.
SparklineGroupsSparklineGroupCollectionGets the sparkline groups in the worksheet.
ChartsChartCollectionGets a Chart collection
CommentsCommentCollectionGets the Comment collection.
PicturesPictureCollectionGets a Picture collection.
TextBoxesTextBoxCollectionGets a TextBox collection.
CheckBoxesCheckBoxCollectionGets a CheckBox collection.
OleObjectsOleObjectCollectionRepresents a collection of OleObject in a worksheet.
ShapesShapeCollectionReturns all drawing shapes in this worksheet.
SlicersSlicerCollectionGet the Slicer collection in the worksheet
TimelinesTimelineCollectionGet the Timeline collection in the worksheet
IndexintGets the index of sheet in the worksheet collection.
IsProtectedbooleanIndicates if the worksheet is protected.
ValidationsValidationCollectionGets the data validation setting collection in the worksheet.
AllowEditRangesProtectedRangeCollectionGets the allow edit range collection in the worksheet.
ErrorCheckOptionsErrorCheckOptionCollectionGets error check setting applied on certain ranges.
OutlineOutlineGets the outline on this worksheet.
FirstVisibleRowintRepresents first visible row index.
FirstVisibleColumnintRepresents first visible column index.
ZoomintRepresents the scaling factor in percentage. It should be between 10 and 400. Please set the view type first.
ViewTypeintGets and sets the view type. The value of the property is ViewType integer constant.
IsPageBreakPreviewbooleanIndicates whether the specified worksheet is shown in normal view or page break preview.
IsRulerVisiblebooleanIndicates whether the ruler is visible. This property is only applied for page break preview.
TabColorColorRepresents worksheet tab color. This feature is only supported in ExcelXP(Excel2002) and later versions. If you save fil
GridlineColorColor
CodeNameStringGets worksheet code name.
BackgroundImagebyte[]Gets and sets worksheet background image.
ConditionalFormattingsConditionalFormattingCollectionGets the ConditionalFormattings in the worksheet.
ActiveCellStringGets or sets the active cell in the worksheet.
CustomPropertiesCustomPropertyCollectionGets an object representing the identifier information associated with a worksheet. Worksheet.CustomProperties provide a
SmartTagSettingSmartTagSettingGets all SmartTagCollection objects of the worksheet.
ScenariosScenarioCollectionGets the collection of Scenario .
CellWatchesCellWatchCollectionGets collection of cells on this worksheet being watched in the ‘watch window’.

Methods

NameDescription
protectProtects worksheet.

This method protects worksheet without password. It can protect worksheet in all versions of Excel | | unprotect | Unprotects worksheet.

This method unprotects worksheet which is protected without password. | | moveTo | Moves the sheet to another location in the spreadsheet. | | replace | Replaces all cells’ text with a new string. | | getSelectedRanges | Gets selected ranges of cells in the designer spreadsheet. | | getSelectedAreas | | | getPrintingPageBreaks | Gets automatic page breaks.

Each cell area represents a paper. | | toString | Returns a string represents the current Worksheet object. | | startAccessCache | Starts the session that uses caches to access the data in this worksheet.

After finishing the access to the data, close | | closeAccessCache | Closes the session that uses caches to access the data in this worksheet. | | convertFormulaReferenceStyle | Converts the formula reference style. | | calculateFormula | Calculates a formula. | | calculateArrayFormula | Calculates a formula as array formula. | | xmlMapQuery | Query cell areas that mapped/linked to the specific path of xml map. | | refreshPivotTables | Refreshes all the PivotTables in this Worksheet. | | dispose | Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. | | getPanes | Gets the window panes.

If the window is not split or frozen. | | freezePanes | Freezes panes at the specified cell in the worksheet.

Row index and column index cannot all be zero. Number of rows and | | getFreezedPanes | Gets the freeze panes. | | split | Splits window. | | unFreezePanes | Unfreezes panes in the worksheet. | | removeSplit | Removes split window. | | addPageBreaks | Adds page break. | | copy | Copies contents and formats from another worksheet. | | autoFitColumn | Autofits the column width.

This method autofits a row based on content in a range of cells within the row. | | autoFitColumns | Autofits all columns in this worksheet. | | autoFitRow | Autofits the row height.

This method autofits a row based on content in a range of cells within the row. | | autoFitRows | Autofits all rows in this worksheet. | | filter | | | getAdvancedFilter | Gets the settings of advanced filter. | | advancedFilter | Filters data using complex criteria. | | removeAutoFilter | Removes the auto filter of the worksheet. | | setVisible | Sets the visible options. | | selectRange | Selects a range. | | removeAllDrawingObjects | Removes all drawing objects in this worksheet. | | clearComments | Clears all comments in designer spreadsheet. | | getAllPictures | |

Worksheet.Protection property

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.

Type: Protection

Worksheet.UniqueId property

Gets and sets the unique id, it is same as {15DB5C3C-A5A1-48AF-8F25-3D86AC232D4F}.

Type: String

Worksheet.Workbook property

Gets the workbook object which contains this sheet.

Type: Workbook

Worksheet.Cells property

Gets the Cells collection.

Type: Cells

Worksheet.QueryTables property

Gets QueryTableCollection in the worksheet.

Type: QueryTableCollection

Worksheet.Type property

Represents worksheet type. The value of the property is SheetType integer constant.

Type: int

Worksheet.Name property

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.

Type: String

Worksheet.ShowFormulas property

Indicates whether to show formulas or their results.

Type: boolean

Worksheet.ShowDataTypeIcons property

Type: boolean

Worksheet.IsGridlinesVisible property

Gets or sets a value indicating whether the gridlines are visible.Default is true.

Type: boolean

Worksheet.IsRowColumnHeadersVisible property

Gets or sets a value indicating whether the worksheet will display row and column headers. Default is true.

Type: boolean

Worksheet.PaneState property

Indicates whether the pane has horizontal or vertical splits, and whether those splits are frozen. The value of the property is PaneStateType integer constant.

Type: int

Worksheet.DisplayZeros property

True if zero values are displayed.

Type: boolean

Worksheet.DisplayRightToLeft property

Indicates if the specified worksheet is displayed from right to left instead of from left to right. Default is false.

Type: boolean

Worksheet.IsOutlineShown property

Indicates whether to show outline.

Type: boolean

Worksheet.IsSelected property

Indicates whether this worksheet is selected when the workbook is opened.

Type: boolean

Worksheet.PivotTables property

Gets all pivot tables in this worksheet.

Type: PivotTableCollection

Worksheet.ListObjects property

Gets all ListObjects in this worksheet.

Type: ListObjectCollection

Worksheet.TabId property

Specifies the internal identifier for the sheet.

Type: int

Worksheet.HorizontalPageBreaks property

Gets the HorizontalPageBreakCollection collection.

Type: HorizontalPageBreakCollection

Worksheet.VerticalPageBreaks property

Gets the VerticalPageBreakCollection collection.

Type: VerticalPageBreakCollection

Gets the HyperlinkCollection collection.

Type: HyperlinkCollection

Worksheet.PageSetup property

Represents the page setup description in this sheet.

Type: PageSetup

Worksheet.AutoFilter property

Represents auto filter for the specified worksheet.

Type: AutoFilter

Worksheet.HasAutofilter property

Indicates whether this worksheet has auto filter.

Type: boolean

Worksheet.TransitionEvaluation property

Indicates whether the Transition Formula Evaluation (Lotus compatibility) option is enabled.

Type: boolean

Worksheet.TransitionEntry property

Indicates whether the Transition Formula Entry (Lotus compatibility) option is enabled.

Type: boolean

Worksheet.VisibilityType property

Indicates the visible state for this sheet. The value of the property is VisibilityType integer constant.

Type: int

Worksheet.IsVisible property

Represents if the worksheet is visible.

Type: boolean

Worksheet.SparklineGroups property

Gets the sparkline groups in the worksheet.

Type: SparklineGroupCollection

Worksheet.Charts property

Gets a Chart collection

Type: ChartCollection

Worksheet.Comments property

Gets the Comment collection.

Type: CommentCollection

Worksheet.Pictures property

Gets a Picture collection.

Type: PictureCollection

Worksheet.TextBoxes property

Gets a TextBox collection.

Type: TextBoxCollection

Worksheet.CheckBoxes property

Gets a CheckBox collection.

Type: CheckBoxCollection

Worksheet.OleObjects property

Represents a collection of OleObject in a worksheet.

Type: OleObjectCollection

Worksheet.Shapes property

Returns all drawing shapes in this worksheet.

Type: ShapeCollection

Worksheet.Slicers property

Get the Slicer collection in the worksheet

Type: SlicerCollection

Worksheet.Timelines property

Get the Timeline collection in the worksheet

Type: TimelineCollection

Worksheet.Index property

Gets the index of sheet in the worksheet collection.

Type: int

Worksheet.IsProtected property

Indicates if the worksheet is protected.

Type: boolean

Worksheet.Validations property

Gets the data validation setting collection in the worksheet.

Type: ValidationCollection

Worksheet.AllowEditRanges property

Gets the allow edit range collection in the worksheet.

Type: ProtectedRangeCollection

Worksheet.ErrorCheckOptions property

Gets error check setting applied on certain ranges.

Type: ErrorCheckOptionCollection

Worksheet.Outline property

Gets the outline on this worksheet.

Type: Outline

Worksheet.FirstVisibleRow property

Represents first visible row index.

Type: int

Worksheet.FirstVisibleColumn property

Represents first visible column index.

Type: int

Worksheet.Zoom property

Represents the scaling factor in percentage. It should be between 10 and 400. Please set the view type first.

Type: int

Worksheet.ViewType property

Gets and sets the view type. The value of the property is ViewType integer constant.

Type: int

Worksheet.IsPageBreakPreview property

Indicates whether the specified worksheet is shown in normal view or page break preview.

Type: boolean

Worksheet.IsRulerVisible property

Indicates whether the ruler is visible. This property is only applied for page break preview.

Type: boolean

Worksheet.TabColor property

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.

Type: Color

Worksheet.GridlineColor property

Type: Color

Worksheet.CodeName property

Gets worksheet code name.

Type: String

Worksheet.BackgroundImage property

Gets and sets worksheet background image.

Type: byte[]

Worksheet.ConditionalFormattings property

Gets the ConditionalFormattings in the worksheet.

Type: ConditionalFormattingCollection

Worksheet.ActiveCell property

Gets or sets the active cell in the worksheet.

Type: String

Worksheet.CustomProperties property

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.

Type: CustomPropertyCollection

Worksheet.SmartTagSetting property

Gets all SmartTagCollection objects of the worksheet.

Type: SmartTagSetting

Worksheet.Scenarios property

Gets the collection of Scenario .

Type: ScenarioCollection

Worksheet.CellWatches property

Gets collection of cells on this worksheet being watched in the ‘watch window’.

Type: CellWatchCollection

protect(type) (1 of 2)

Protects worksheet.

This method protects worksheet without password. It can protect worksheet in all versions of Excel file.

ParameterTypeDescription
typeintA ProtectionType value. Protection type.

protect(type, password, oldPassword) (2 of 2)

Protects worksheet.

This method can protect worksheet in all versions of Excel file.

ParameterTypeDescription
typeintA ProtectionType value. Protection type.
passwordStringPassword.
oldPasswordStringIf 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() (1 of 2)

Unprotects worksheet.

This method unprotects worksheet which is protected without password.


unprotect(password) (2 of 2)

Unprotects worksheet.

If the worksheet is protected without a password, you can set a null value or blank string to password parameter.

ParameterTypeDescription
passwordStringPassword

moveTo(index)

Moves the sheet to another location in the spreadsheet.

ParameterTypeDescription
indexintDestination sheet index.

replace(oldString, newString)

Replaces all cells’ text with a new string.

ParameterTypeDescription
oldStringStringOld string value.
newStringStringNew string value.

getSelectedRanges()

Gets selected ranges of cells in the designer spreadsheet.

Returns: An java.util.ArrayList which contains selected ranges.

getSelectedAreas()

getPrintingPageBreaks(options)

Gets automatic page breaks.

Each cell area represents a paper.

ParameterTypeDescription
optionsImageOrPrintOptionsThe print options

Returns: The automatic page breaks areas.

toString()

Returns a string represents the current Worksheet object.

startAccessCache(opts)

Starts the session that uses caches to access the data in this worksheet.

After finishing the access to the data, closeAccessCache(int) should be invoked with same options to clear all caches and recover normal access mode.

ParameterTypeDescription
optsintA AccessCacheOptions value. options of data access

closeAccessCache(opts)

Closes the session that uses caches to access the data in this worksheet.

ParameterTypeDescription
optsintA AccessCacheOptions value. options of data access

convertFormulaReferenceStyle(formula, toR1C1, baseCellRow, baseCellColumn)

Converts the formula reference style.

ParameterTypeDescription
formulaStringThe formula to be converted.
toR1C1booleanWhich reference style to convert the formula to. If the original formula is of A1 reference style, then this value should be true so the formula will be converted from A1 to R1C1 reference style; If the original formula is of R1C1 reference style, then this value should be false so the formula will be converted from R1C1 to A1 reference style;
baseCellRowintThe row index of the base cell.
baseCellColumnintThe column index of the base cell.

Returns: The converted formula.

calculateFormula(formula) (1 of 4)

Calculates a formula.

ParameterTypeDescription
formulaStringFormula to be calculated.

Returns: Calculated formula result.


calculateFormula(formula, opts) (2 of 4)

Calculates a formula expression directly.

The formula will be calculated just like it has been set to cell A1. And the formula will be taken as normal formula. If you need the formula be calculated as an array formula and to get an array for the calculated result, please use calculateArrayFormula(java.lang.String, com.aspose.cells.CalculationOptions) instead.

ParameterTypeDescription
formulaStringFormula to be calculated.
optsCalculationOptionsOptions for calculating formula

Returns: Calculated result of given formula. The returned object may be of possible types of Cell.Value , or ReferredArea.


calculateFormula(formula, pOpts, cOpts, baseCellRow, baseCellColumn, calculationData) (3 of 4)

Calculates a formula expression directly.

The formula will be calculated just like it has been set to the specified base cell. And the formula will be taken as normal formula. If you need the formula be calculated as an array formula and to get an array for the calculated result, please use calculateArrayFormula(java.lang.String, com.aspose.cells.FormulaParseOptions, com.aspose.cells.CalculationOptions, int, int, int, int, com.aspose.cells.CalculationData) instead.

ParameterTypeDescription
formulaStringFormula to be calculated.
pOptsFormulaParseOptionsOptions for parsing formula.
cOptsCalculationOptionsOptions for calculating formula.
baseCellRowintThe row index of the base cell.
baseCellColumnintThe column index of the base cell.
calculationDataCalculationDataThe calculation data. It is used for the situation that user needs to calculate some static formulas when implementing custom calculation engine. For such kind of situation, user needs to specify it with the calculation data provided for #Error Cref: M:Aspose.Cells.AbstractCalculationEngine.Calculate(Aspose.Cells.CalculationData) .

Returns: Calculated result of given formula. The returned object may be of possible types of Cell.Value , or ReferredArea.


calculateFormula(options, recursive) (4 of 4)

Calculates all formulas in this worksheet.

ParameterTypeDescription
optionsCalculationOptionsOptions for calculation
recursivebooleanTrue means if the worksheet’ cells depend on the cells of other worksheets, the dependent cells in other worksheets will be calculated too. False means all the formulas in the worksheet have been calculated and the values are right.

calculateArrayFormula(formula, opts) (1 of 3)

Calculates a formula as array formula.

ParameterTypeDescription
formulaStringFormula to be calculated.
optsCalculationOptionsOptions for calculating formula

calculateArrayFormula(formula, opts, maxRowCount, maxColumnCount) (2 of 3)

Calculates a formula as array formula.

The formula will be taken as dynamic array formula to calculate the dimension and result. User specified maximum dimension is used for cases that the calculated result is large data set (for example, the calculated result may correspond to a whole row or column data) but user does not need so large an array according to business requirement or for performance consideration.

ParameterTypeDescription
formulaStringFormula to be calculated.
optsCalculationOptionsOptions for calculating formula
maxRowCountintthe maximum row count of resultant data. If it is non-positive or greater than the actual row count, then actual row count will be used.
maxColumnCountintthe maximum column count of resultant data. If it is non-positive or greater than the actual row count, then actual column count will be used.

Returns: Calculated formula result.


calculateArrayFormula(formula, pOpts, cOpts, baseCellRow, baseCellColumn, maxRowCount, maxColumnCount, calculationData) (3 of 3)

Calculates a formula as array formula.

The formula will be taken as dynamic array formula to calculate the dimension and result. User specified maximum dimension is used for cases that the calculated result is large data set (for example, the calculated result may correspond to a whole row or column data) but user does not need so large an array according to business requirement or for performance consideration.

ParameterTypeDescription
formulaStringFormula to be calculated.
pOptsFormulaParseOptionsOptions for parsing formula
cOptsCalculationOptionsOptions for calculating formula
baseCellRowintThe row index of the base cell.
baseCellColumnintThe column index of the base cell.
maxRowCountintThe maximum row count of resultant data. If it is non-positive or greater than the actual row count, then actual row count will be used.
maxColumnCountintThe maximum column count of resultant data. If it is non-positive or greater than the actual row count, then actual column count will be used.
calculationDataCalculationDataThe calculation data. It is used for the situation that user needs to calculate some static formulas when implementing custom calculation engine. For such kind of situation, user needs to specify it with the calculation data provided for #Error Cref: M:Aspose.Cells.AbstractCalculationEngine.Calculate(Aspose.Cells.CalculationData) .

Returns: Calculated formula result.

xmlMapQuery(path, xmlMap)

Query cell areas that mapped/linked to the specific path of xml map.

ParameterTypeDescription
pathStringxml element path
xmlMapXmlMapSpecify 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() (1 of 2)

Refreshes all the PivotTables in this Worksheet.


refreshPivotTables(option) (2 of 2)

Refreshes all the PivotTables in this Worksheet.

ParameterTypeDescription
optionPivotTableRefreshOptionThe option for refreshing data source of pivot table.

dispose()

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

getPanes()

Gets the window panes.

If the window is not split or frozen.

freezePanes(row, column, freezedRows, freezedColumns) (1 of 2)

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 froze position and the last two parameters specify the area frozen on the left top pane.

ParameterTypeDescription
rowintRow index.
columnintColumn index.
freezedRowsintNumber of visible rows in top pane, no more than row index.
freezedColumnsintNumber of visible columns in left pane, no more than column index.

freezePanes(cellName, freezedRows, freezedColumns) (2 of 2)

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.

ParameterTypeDescription
cellNameStringCell name.
freezedRowsintNumber of visible rows in top pane, no more than row index.
freezedColumnsintNumber of visible columns in left pane, no more than column index.

getFreezedPanes()

Gets the freeze panes.

Returns: Return null means the worksheet is not frozen 0:Row index;1:column;2:freezedRows;3:freezedRows

split()

Splits window.

unFreezePanes()

Unfreezes panes in the worksheet.

removeSplit()

Removes split window.

addPageBreaks(cellName)

Adds page break.

ParameterTypeDescription
cellNameString

copy(sourceSheet) (1 of 2)

Copies contents and formats from another worksheet.

ParameterTypeDescription
sourceSheetWorksheetSource worksheet.

copy(sourceSheet, copyOptions) (2 of 2)

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.

ParameterTypeDescription
sourceSheetWorksheetSource worksheet.
copyOptionsCopyOptions

autoFitColumn(columnIndex, firstRow, lastRow) (1 of 2)

Autofits the column width.

This method autofits a row based on content in a range of cells within the row.

ParameterTypeDescription
columnIndexintColumn index.
firstRowintFirst row index.
lastRowintLast row index.

autoFitColumn(columnIndex) (2 of 2)

Autofits the column width.

AutoFitColumn is an imprecise function.

ParameterTypeDescription
columnIndexintColumn index.

autoFitColumns() (1 of 6)

Autofits all columns in this worksheet.


autoFitColumns(options) (2 of 6)

Autofits all columns in this worksheet.

ParameterTypeDescription
optionsAutoFitterOptionsThe auto fitting options

autoFitColumns(firstColumn, lastColumn) (3 of 6)

Autofits the columns width.

AutoFitColumn is an imprecise function.

ParameterTypeDescription
firstColumnintFirst column index.
lastColumnintLast column index.

autoFitColumns(firstColumn, lastColumn, options) (4 of 6)

Autofits the columns width.

AutoFitColumn is an imprecise function.

ParameterTypeDescription
firstColumnintFirst column index.
lastColumnintLast column index.
optionsAutoFitterOptionsThe auto fitting options

autoFitColumns(firstRow, firstColumn, lastRow, lastColumn) (5 of 6)

Autofits the columns width.

AutoFitColumn is an imprecise function.

ParameterTypeDescription
firstRowintFirst row index.
firstColumnintFirst column index.
lastRowintLast row index.
lastColumnintLast column index.

autoFitColumns(firstRow, firstColumn, lastRow, lastColumn, options) (6 of 6)

Autofits the columns width.

AutoFitColumn is an imprecise function.

ParameterTypeDescription
firstRowintFirst row index.
firstColumnintFirst column index.
lastRowintLast row index.
lastColumnintLast column index.
optionsAutoFitterOptionsThe auto fitting options

autoFitRow(rowIndex, firstColumn, lastColumn) (1 of 4)

Autofits the row height.

This method autofits a row based on content in a range of cells within the row.

ParameterTypeDescription
rowIndexintRow index.
firstColumnintFirst column index.
lastColumnintLast column index.

autoFitRow(rowIndex, firstColumn, lastColumn, options) (2 of 4)

Autofits the row height.

This method autofits a row based on content in a range of cells within the row.

ParameterTypeDescription
rowIndexintRow index.
firstColumnintFirst column index.
lastColumnintLast column index.
optionsAutoFitterOptionsThe auto fitter options

autoFitRow(startRow, endRow, startColumn, endColumn) (3 of 4)

Autofits row height in a rectangle range.

ParameterTypeDescription
startRowintStart row index.
endRowintEnd row index.
startColumnintStart column index.
endColumnintEnd column index.

autoFitRow(rowIndex) (4 of 4)

Autofits the row height.

AutoFitRow is an imprecise function.

ParameterTypeDescription
rowIndexintRow index.

autoFitRows() (1 of 5)

Autofits all rows in this worksheet.


autoFitRows(onlyAuto) (2 of 5)

Autofits all rows in this worksheet.

ParameterTypeDescription
onlyAutobooleanTrue,only autofits the row height when row height is not customed.

autoFitRows(options) (3 of 5)

Autofits all rows in this worksheet.

ParameterTypeDescription
optionsAutoFitterOptionsThe auto fitter options

autoFitRows(startRow, endRow) (4 of 5)

Autofits row height in a range.

ParameterTypeDescription
startRowintStart row index.
endRowintEnd row index.

autoFitRows(startRow, endRow, options) (5 of 5)

Autofits row height in a range.

ParameterTypeDescription
startRowintStart row index.
endRowintEnd row index.
optionsAutoFitterOptionsThe options of auto fitter.

filter(ca)

getAdvancedFilter()

Gets the settings of advanced filter.

advancedFilter(isFilter, listRange, criteriaRange, copyTo, uniqueRecordOnly)

Filters data using complex criteria.

ParameterTypeDescription
isFilterbooleanIndicates whether filtering the list in place.
listRangeStringThe list range.
criteriaRangeStringThe criteria range.
copyToStringThe range where copying data to.
uniqueRecordOnlybooleanOnly displaying or copying unique rows.

removeAutoFilter()

Removes the auto filter of the worksheet.

setVisible(isVisible, ignoreError)

Sets the visible options.

ParameterTypeDescription
isVisiblebooleanWhether the worksheet is visible
ignoreErrorbooleanWhether to ignore error if this option is not valid.

selectRange(startRow, startColumn, totalRows, totalColumns, removeOthers)

Selects a range.

ParameterTypeDescription
startRowintThe start row.
startColumnintThe start column
totalRowsintThe number of rows.
totalColumnsintThe number of columns
removeOthersbooleanTrue means removing other selected range and only select this range.

removeAllDrawingObjects()

Removes all drawing objects in this worksheet.

clearComments()

Clears all comments in designer spreadsheet.

getAllPictures()