Cells

Cells class

Encapsulates a collection of cell relevant objects, such as Cell, Row, …etc.

class Cells;

Example

const { Workbook } = require("aspose.cells.node");

var excel = new Workbook();
var cells = excel.worksheets.get(0).cells;
//Set default row height
cells.standardHeight = 20;
//Set row height
cells.setRowHeight(2, 20.5);
//Set default colum width
cells.standardWidth = 15;
//Set column width
cells.setColumnWidth(3, 12.57);
//Merge cells
cells.merge(5, 4, 2, 2);

Properties

PropertyTypeDescription
odsCellFieldsOdsCellFieldCollectionReadonly. Gets the list of fields of ods.
countnumberReadonly. Gets the total count of instantiated Cell objects.
countLargenumberReadonly. Gets the total count of instantiated Cell objects.
rowsRowCollectionReadonly. Gets the collection of Row objects that represents the individual rows in this worksheet.
multiThreadReadingbooleanGets or sets whether the cells data model should support Multi-Thread reading. Default value of this property is false.
memorySettingMemorySettingGets or sets the memory usage option for this cells.
styleStyleGets and sets the default style of the worksheet.
isDefaultColumnHiddenboolean
standardWidthInchnumberGets or sets the default column width in the worksheet, in unit of inches.
standardWidthPixelsnumberGets or sets the default column width in the worksheet, in unit of pixels.
standardWidthnumberGets or sets the default column width in the worksheet, in unit of characters.
standardHeightnumberGets or sets the default row height in this worksheet, in unit of points.
standardHeightPixelsnumberGets or sets the default row height in this worksheet, in unit of pixels.
standardHeightInchnumberGets or sets the default row height in this worksheet, in unit of inches.
preserveStringbooleanGets or sets a value indicating whether all worksheet values are preserved as strings. Default is false.
minRownumberReadonly. Minimum row index of cell which contains data or style.
maxRownumberReadonly. Maximum row index of cell which contains data or style.
minColumnnumberReadonly. Minimum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it).
maxColumnnumberReadonly. Maximum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it).
minDataRownumberReadonly. Minimum row index of cell which contains data.
maxDataRownumberReadonly. Maximum row index of cell which contains data.
minDataColumnnumberReadonly. Minimum column index of cell which contains data.
maxDataColumnnumberReadonly. Maximum column index of cell which contains data.
isDefaultRowHeightMatchedbooleanIndicates that row height and default font height matches
isDefaultRowHiddenbooleanIndicates whether the row is default hidden.
columnsColumnCollectionReadonly. Gets the collection of Column objects that represents the individual columns in this worksheet.
rangesRangeCollectionReadonly. Gets the collection of Range objects created at run time.
lastCellCellReadonly. Gets the last cell in this worksheet.
maxDisplayRangeRangeReadonly. Gets the max range which includes data, merged cells and shapes.
firstCellCellReadonly. Gets the first cell in this worksheet.

Methods

MethodDescription
get(number, number)Gets the Cell element at the specified cell row index and column index.
get(string)Gets the Cell element at the specified cell name.
getOdsCellFields()@deprecated. Please use the ‘odsCellFields’ property instead. Gets the list of fields of ods.
getCount()@deprecated. Please use the ‘count’ property instead. Gets the total count of instantiated Cell objects.
getCountLarge()@deprecated. Please use the ‘countLarge’ property instead. Gets the total count of instantiated Cell objects.
getRows()@deprecated. Please use the ‘rows’ property instead. Gets the collection of Row objects that represents the individual rows in this worksheet.
getMultiThreadReading()@deprecated. Please use the ‘multiThreadReading’ property instead. Gets or sets whether the cells data model should support Multi-Thread reading. Default value of this property is false.
setMultiThreadReading(boolean)@deprecated. Please use the ‘multiThreadReading’ property instead. Gets or sets whether the cells data model should support Multi-Thread reading. Default value of this property is false.
getMemorySetting()@deprecated. Please use the ‘memorySetting’ property instead. Gets or sets the memory usage option for this cells.
setMemorySetting(MemorySetting)@deprecated. Please use the ‘memorySetting’ property instead. Gets or sets the memory usage option for this cells.
getStyle()@deprecated. Please use the ‘style’ property instead. Gets and sets the default style of the worksheet.
setStyle(Style)@deprecated. Please use the ‘style’ property instead. Gets and sets the default style of the worksheet.
isDefaultColumnHidden()@deprecated. Please use the ‘isDefaultColumnHidden’ property instead.
setIsDefaultColumnHidden(boolean)@deprecated. Please use the ‘isDefaultColumnHidden’ property instead.
getStandardWidthInch()@deprecated. Please use the ‘standardWidthInch’ property instead. Gets or sets the default column width in the worksheet, in unit of inches.
setStandardWidthInch(number)@deprecated. Please use the ‘standardWidthInch’ property instead. Gets or sets the default column width in the worksheet, in unit of inches.
getStandardWidthPixels()@deprecated. Please use the ‘standardWidthPixels’ property instead. Gets or sets the default column width in the worksheet, in unit of pixels.
setStandardWidthPixels(number)@deprecated. Please use the ‘standardWidthPixels’ property instead. Gets or sets the default column width in the worksheet, in unit of pixels.
getStandardWidth()@deprecated. Please use the ‘standardWidth’ property instead. Gets or sets the default column width in the worksheet, in unit of characters.
setStandardWidth(number)@deprecated. Please use the ‘standardWidth’ property instead. Gets or sets the default column width in the worksheet, in unit of characters.
getStandardHeight()@deprecated. Please use the ‘standardHeight’ property instead. Gets or sets the default row height in this worksheet, in unit of points.
setStandardHeight(number)@deprecated. Please use the ‘standardHeight’ property instead. Gets or sets the default row height in this worksheet, in unit of points.
getStandardHeightPixels()@deprecated. Please use the ‘standardHeightPixels’ property instead. Gets or sets the default row height in this worksheet, in unit of pixels.
setStandardHeightPixels(number)@deprecated. Please use the ‘standardHeightPixels’ property instead. Gets or sets the default row height in this worksheet, in unit of pixels.
getStandardHeightInch()@deprecated. Please use the ‘standardHeightInch’ property instead. Gets or sets the default row height in this worksheet, in unit of inches.
setStandardHeightInch(number)@deprecated. Please use the ‘standardHeightInch’ property instead. Gets or sets the default row height in this worksheet, in unit of inches.
getPreserveString()@deprecated. Please use the ‘preserveString’ property instead. Gets or sets a value indicating whether all worksheet values are preserved as strings. Default is false.
setPreserveString(boolean)@deprecated. Please use the ‘preserveString’ property instead. Gets or sets a value indicating whether all worksheet values are preserved as strings. Default is false.
getMinRow()@deprecated. Please use the ‘minRow’ property instead. Minimum row index of cell which contains data or style.
getMaxRow()@deprecated. Please use the ‘maxRow’ property instead. Maximum row index of cell which contains data or style.
getMinColumn()@deprecated. Please use the ‘minColumn’ property instead. Minimum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it).
getMaxColumn()@deprecated. Please use the ‘maxColumn’ property instead. Maximum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it).
getMinDataRow()@deprecated. Please use the ‘minDataRow’ property instead. Minimum row index of cell which contains data.
getMaxDataRow()@deprecated. Please use the ‘maxDataRow’ property instead. Maximum row index of cell which contains data.
getMinDataColumn()@deprecated. Please use the ‘minDataColumn’ property instead. Minimum column index of cell which contains data.
getMaxDataColumn()@deprecated. Please use the ‘maxDataColumn’ property instead. Maximum column index of cell which contains data.
isDefaultRowHeightMatched()@deprecated. Please use the ‘isDefaultRowHeightMatched’ property instead. Indicates that row height and default font height matches
setIsDefaultRowHeightMatched(boolean)@deprecated. Please use the ‘isDefaultRowHeightMatched’ property instead. Indicates that row height and default font height matches
isDefaultRowHidden()@deprecated. Please use the ‘isDefaultRowHidden’ property instead. Indicates whether the row is default hidden.
setIsDefaultRowHidden(boolean)@deprecated. Please use the ‘isDefaultRowHidden’ property instead. Indicates whether the row is default hidden.
getColumns()@deprecated. Please use the ‘columns’ property instead. Gets the collection of Column objects that represents the individual columns in this worksheet.
getRanges()@deprecated. Please use the ‘ranges’ property instead. Gets the collection of Range objects created at run time.
getLastCell()@deprecated. Please use the ’lastCell’ property instead. Gets the last cell in this worksheet.
getMaxDisplayRange()@deprecated. Please use the ‘maxDisplayRange’ property instead. Gets the max range which includes data, merged cells and shapes.
getFirstCell()@deprecated. Please use the ‘firstCell’ property instead. Gets the first cell in this worksheet.
dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
getEnumerator()Gets the cells enumerator.
getMergedAreas()Gets all merged cells.
getCell(number, number)Gets the Cell element or null at the specified cell row index and column index.
getRow(number)Gets the Row element at the specified cell row index.
checkCell(number, number)Gets the Cell element or null at the specified cell row index and column index.
checkRow(number)Gets the Row element or null at the specified cell row index.
checkColumn(number)Gets the Column element or null at the specified column index.
isRowHidden(number)Checks whether a row at given index is hidden.
isColumnHidden(number)Checks whether a column at given index is hidden.
addRange(Range)Adds a range object reference to cells
createRange(string, string)Creates a Range object from a range of cells.
createRange(number, number, number, number)Creates a Range object from a range of cells.
createRange(string)Creates a Range object from an address of the range.
createRange(number, number, boolean)Creates a Range object from rows of cells or columns of cells.
clear()Clears all data of the worksheet.
importFormulaArray(string[], number, number, boolean)Imports an array of formula into a worksheet.
textToColumns(number, number, number, TxtLoadOptions)Splits content in specified column into multiple columns..
importCSV(string, string, boolean, number, number)Import a CSV file to the cells.
importCSV(Uint8Array, string, boolean, number, number)Import a CSV file to the cells.
importCSV(string, TxtLoadOptions, number, number)Import a CSV file to the cells.
importCSV(Uint8Array, TxtLoadOptions, number, number)Import a CSV file to the cells.
importCSVAsync(string, string, boolean, number, number)Import a CSV file to the cells.
importCSVAsync(Uint8Array, string, boolean, number, number)Import a CSV file to the cells.
importCSVAsync(string, TxtLoadOptions, number, number)Import a CSV file to the cells.
importCSVAsync(Uint8Array, TxtLoadOptions, number, number)Import a CSV file to the cells.
merge(number, number, number, number)Merges a specified range of cells into a single cell.
merge(number, number, number, number, boolean)Merges a specified range of cells into a single cell.
merge(number, number, number, number, boolean, boolean)Merges a specified range of cells into a single cell.
unMerge(number, number, number, number)Unmerges a specified range of merged cells.
clearMergedCells()Clears all merged ranges.
hideRow(number)Hides a row.
unhideRow(number, number)Unhides a row.
hideRows(number, number)Hides multiple rows.
unhideRows(number, number, number)Unhides the hidden rows.
setRowHeightPixel(number, number)Sets row height in unit of pixels.
setRowHeightInch(number, number)Sets row height in unit of inches.
setRowHeight(number, number)Sets the height of the specified row.
getRowHeight(number, boolean, CellsUnitType)Gets row’s height.
getRowHeight(number)Gets the height of a specified row, in unit of points.
getRowOriginalHeightPoint(number)Gets original row’s height in unit of point if the row is hidden
getColumnWidth(number, boolean, CellsUnitType)Gets the column width.
getColumnWidth(number)Gets the width(in unit of characters) of the specified column in normal view
getColumnOriginalWidthPoint(number)Gets original column’s height in unit of point if the column is hidden
hideColumn(number)Hides a column.
unhideColumn(number, number)Unhides a column
hideColumns(number, number)Hide multiple columns.
unhideColumns(number, number, number)Unhide multiple columns.
getViewRowHeight(number)Gets the height of a specified row.
getRowHeightInch(number)Gets the height of a specified row in unit of inches.
getViewRowHeightInch(number)Gets the height of a specified row in unit of inches.
getRowHeightPixel(number)Gets the height of a specified row in unit of pixel.
setColumnWidthPixel(number, number)Sets column width in unit of pixels in normal view.
setColumnWidthInch(number, number)Sets column width in unit of inches in normal view.
setColumnWidth(number, number)Sets the width of the specified column in normal view.
getColumnWidthPixel(number)Gets the width of the specified column in normal view, in units of pixel.
getColumnWidthPixel(number, boolean)Gets the width of the specified column in normal view, in units of pixel.
getColumnWidthInch(number)Gets the width of the specified column in normal view, in units of inches.
getViewColumnWidthPixel(number)Get the width in different view type.
setViewColumnWidthPixel(number, number)Sets the width of the column in different view.
getLastDataRow(number)Gets the last row index of cell which contains data in the specified column.
getFirstDataRow(number)Gets the first row index of cell which contains data in the specified column.
applyColumnStyle(number, Style, StyleFlag)Applies formats for a whole column.
applyRowStyle(number, Style, StyleFlag)Applies formats for a whole row.
applyStyle(Style, StyleFlag)Applies formats for a whole worksheet.
copyColumns(Cells, number, number, number, PasteOptions)Copies data and formats of a whole column.
copyColumns(Cells, number, number, number)Copies data and formats of whole columns.
copyColumns(Cells, number, number, number, number)Copies data and formats of the whole columns.
copyColumn(Cells, number, number)Copies data and formats of a whole column.
copyRow(Cells, number, number)Copies data and formats of a whole row.
copyRows(Cells, number, number, number)Copies data and formats of some whole rows.
copyRows(Cells, number, number, number, CopyOptions)Copies data and formats of some whole rows.
copyRows(Cells, number, number, number, CopyOptions, PasteOptions)Copies data and formats of some whole rows.
getGroupedRowOutlineLevel(number)Gets the outline level (zero-based) of the row.
getGroupedColumnOutlineLevel(number)Gets the outline level (zero-based) of the column.
getMaxGroupedColumnOutlineLevel()Gets the max grouped column outline level (zero-based).
getMaxGroupedRowOutlineLevel()Gets the max grouped row outline level (zero-based).
showGroupDetail(boolean, number)Expands the grouped rows/columns.
hideGroupDetail(boolean, number)Collapses the grouped rows/columns.
ungroupColumns(number, number)Ungroups columns.
groupColumns(number, number)Groups columns.
groupColumns(number, number, boolean)Groups columns.
ungroupRows(number, number, boolean)Ungroups rows.
ungroupRows(number, number)Ungroups rows.
groupRows(number, number, boolean)Groups rows.
groupRows(number, number)Groups rows.
deleteColumn(number, boolean)Deletes a column.
deleteColumn(number)Deletes a column.
deleteColumns(number, number, boolean)Deletes several columns.
deleteColumns(number, number, DeleteOptions)Deletes several columns.
isDeletingRangeEnabled(number, number, number, number)Check whether the range could be deleted.
deleteRow(number)Deletes a row.
deleteRow(number, boolean)Deletes a row.
deleteRows(number, number)Deletes multiple rows.
deleteRows(number, number, boolean)Deletes multiple rows in the worksheet.
deleteRows(number, number, DeleteOptions)Deletes multiple rows in the worksheet.
deleteBlankColumns()Delete all blank columns which do not contain any data.
deleteBlankColumns(DeleteOptions)Delete all blank columns which do not contain any data.
isBlankColumn(number)Checks whether given column is blank(does not contain any data).
deleteBlankRows()Delete all blank rows which do not contain any data or other object.
deleteBlankRows(DeleteOptions)Delete all blank rows which do not contain any data or some special objects such as visible comment, pivot table.
insertColumns(number, number)Inserts some columns into the worksheet.
insertColumns(number, number, boolean)Inserts some columns into the worksheet.
insertColumns(number, number, InsertOptions)Inserts some columns into the worksheet.
insertColumn(number, boolean)Inserts a new column into the worksheet.
insertColumn(number)Inserts a new column into the worksheet.
insertRows(number, number, boolean)Inserts multiple rows into the worksheet.
insertRows(number, number, InsertOptions)Inserts multiple rows into the worksheet.
insertRows(number, number)Inserts multiple rows into the worksheet.
insertRow(number)Inserts a new row into the worksheet.
clearRange(CellArea)Clears contents and formatting of a range.
clearRange(number, number, number, number)Clears contents and formatting of a range.
clearContents(CellArea)Clears contents of a range.
clearContents(number, number, number, number)Clears contents of a range.
clearFormats(CellArea)Clears formatting of a range.
clearFormats(number, number, number, number)Clears formatting of a range.
linkToXmlMap(string, number, number, string)Link to a xml map.
find(Object, Cell)Finds the cell containing with the input object.
find(Object, Cell, FindOptions)Finds the cell containing with the input object.
endCellInRow(number)Gets the last cell in this row.
endCellInRow(number, number, number, number)Gets the last cell with maximum row index in this range.
endCellInColumn(number)Gets the last cell in this column.
endCellInColumn(number, number, number, number)Gets the last cell with maximum column index in this range.
moveRange(CellArea, number, number)Moves the range.
insertCutCells(Range, number, number, ShiftType)Insert cut range.
insertRange(CellArea, number, ShiftType, boolean)Inserts a range of cells and shift cells according to the shift option.
insertRange(CellArea, ShiftType)Inserts a range of cells and shift cells according to the shift option.
insertRange(CellArea, number, ShiftType)Inserts a range of cells and shift cells according to the shift option.
deleteRange(number, number, number, number, ShiftType)Deletes a range of cells and shift cells according to the shift option.
exportArray(number, number, number, number)Exports data in the Cells collection to a two-dimension array object.
retrieveSubtotalSetting(CellArea)Retrieves subtotals setting of the range.
subtotal(CellArea, number, ConsolidationFunction, number[])Creates subtotals for the range.
subtotal(CellArea, number, ConsolidationFunction, number[], boolean, boolean, boolean)Creates subtotals for the range.
removeFormulas()Removes all formula and replaces with the value of the formula.
removeDuplicates()Removes duplicate rows in the sheet.
removeDuplicates(number, number, number, number)Removes duplicate values in the range.
removeDuplicates(number, number, number, number, boolean, number[])Removes duplicate data of the range.
convertStringToNumericValue()Converts all string data in the worksheet to numeric value if possible.
getDependents(boolean, number, number)Get all cells which refer to the specific cell.
getDependentsInCalculation(number, number, boolean)Gets all cells whose calculated result depends on specific cell.
getCellsWithPlaceInCellPicture()Gets all cells that contain embedded picture.
getCellStyle(number, number)Get the style of given cell.
getCellDisplayStyle(number, number)Get the display style of given cell.
getCellDisplayStyle(number, number, BorderType)Get the display style of given cell.
isNull()Checks whether the implementation object is null.

odsCellFields

Readonly. Gets the list of fields of ods.

odsCellFields : OdsCellFieldCollection;

count

Readonly. Gets the total count of instantiated Cell objects.

count : number;

countLarge

Readonly. Gets the total count of instantiated Cell objects.

countLarge : number;

rows

Readonly. Gets the collection of Row objects that represents the individual rows in this worksheet.

rows : RowCollection;

multiThreadReading

Gets or sets whether the cells data model should support Multi-Thread reading. Default value of this property is false.

multiThreadReading : boolean;

Remarks

If there are multiple threads to read Row/Cell objects in this collection concurrently, this property should be set as true, otherwise unexpected result may be produced. Supporting Multi-Thread reading may degrade the performance for accessing Row/Cell objects from this collection. Please note, some features cannot support Multi-Thread reading, such as formatting values(by Cell.StringValue, Cell.DisplayStringValue, .etc.). So, even with this property being set as true, those APIs still may give unexpected result for Multi-Thread reading.

memorySetting

Gets or sets the memory usage option for this cells.

memorySetting : MemorySetting;

Remarks

Notable limits and recommended operations for some modes: Mode Remarks Supported MemorySetting.MemoryPreference Cells data will be maintained in compact format to decrease the memory cost. On other hand, the compact data also may cause higher time cost, especially when updating the cells data, or accessing cells/rows randomly v8.0.0 MemorySetting.FileCache When this mode is used for any worksheet in one workbook, Workbook.Dispose() should be called at the end of work to release all resources such as the temporary files.

Randomly accessing cells will give poor performance because data needs to be read/updated randomly and repeatedly(so the pointer in the file will be changed accordingly and IO operations will be required repeatedly). If possible, please always access the data sequentially(row by row).

When the data of one row/cell be changed, data of other cells/rows may also be influenced(such as the data be shifted/moved to other places to allocated enough spaces for the changed data). So every change of every data requires synchronization of other existing objects( such as Row or Cell object). So, to get better performance, please do not maintain multiple Rows/Cells at the same time. Processing them one by one will reduce the data synchronization for them so the performance can be improved a bit.
v25.7
</list

style

Gets and sets the default style of the worksheet.

style : Style;

isDefaultColumnHidden

isDefaultColumnHidden : boolean;

standardWidthInch

Gets or sets the default column width in the worksheet, in unit of inches.

standardWidthInch : number;

standardWidthPixels

Gets or sets the default column width in the worksheet, in unit of pixels.

standardWidthPixels : number;

standardWidth

Gets or sets the default column width in the worksheet, in unit of characters.

standardWidth : number;

standardHeight

Gets or sets the default row height in this worksheet, in unit of points.

standardHeight : number;

standardHeightPixels

Gets or sets the default row height in this worksheet, in unit of pixels.

standardHeightPixels : number;

standardHeightInch

Gets or sets the default row height in this worksheet, in unit of inches.

standardHeightInch : number;

preserveString

Gets or sets a value indicating whether all worksheet values are preserved as strings. Default is false.

preserveString : boolean;

minRow

Readonly. Minimum row index of cell which contains data or style.

minRow : number;

Remarks

This property needs to iterate and check cells and rows dynamically, so it is a time-consumed progress and should not be invoked repeatedly, such as using it directly as condition in a loop.

maxRow

Readonly. Maximum row index of cell which contains data or style.

maxRow : number;

Remarks

Return -1 if there is no cell which contains data or style in the worksheet. This property needs to iterate and check cells and rows dynamically, so it is a time-consumed progress and should not be invoked repeatedly, such as using it directly as condition in a loop.

minColumn

Readonly. Minimum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it).

minColumn : number;

Remarks

This property needs to iterate and check cells and rows dynamically, so it is a time-consumed progress and should not be invoked repeatedly, such as using it directly as condition in a loop.

maxColumn

Readonly. Maximum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it).

maxColumn : number;

Remarks

Return -1 if there is no cell has been instantiated.

minDataRow

Readonly. Minimum row index of cell which contains data.

minDataRow : number;

Remarks

Return -1 if there is no cell which contains data. This property needs to iterate and check cells and rows dynamically, so it is a time-consumed progress and should not be invoked repeatedly, such as using it directly as condition in a loop.

maxDataRow

Readonly. Maximum row index of cell which contains data.

maxDataRow : number;

Remarks

Return -1 if there is no cell which contains data. This property needs to iterate and check cells and rows dynamically, so it is a time-consumed progress and should not be invoked repeatedly, such as using it directly as condition in a loop.

minDataColumn

Readonly. Minimum column index of cell which contains data.

minDataColumn : number;

Remarks

-1 will be returned if there is no cell which contains data. This property needs to iterate and check all cells in a worksheet dynamically, so it is a time-consumed progress and should not be invoked repeatedly, such as using it directly as condition in a loop.

maxDataColumn

Readonly. Maximum column index of cell which contains data.

maxDataColumn : number;

Remarks

-1 will be returned if there is no cell which contains data. This property needs to iterate and check all cells in a worksheet dynamically, so it is a time-consumed progress and should not be invoked repeatedly, such as using it directly as condition in a loop.

isDefaultRowHeightMatched

Indicates that row height and default font height matches

isDefaultRowHeightMatched : boolean;

isDefaultRowHidden

Indicates whether the row is default hidden.

isDefaultRowHidden : boolean;

columns

Readonly. Gets the collection of Column objects that represents the individual columns in this worksheet.

columns : ColumnCollection;

ranges

Readonly. Gets the collection of Range objects created at run time.

ranges : RangeCollection;

lastCell

Readonly. Gets the last cell in this worksheet.

lastCell : Cell;

Remarks

Returns null if there is no data in the worksheet.

maxDisplayRange

Readonly. Gets the max range which includes data, merged cells and shapes.

maxDisplayRange : Range;

Remarks

Reutrns null if the worksheet is empty since Aspose.Cells 21.5.2.

firstCell

Readonly. Gets the first cell in this worksheet.

firstCell : Cell;

Remarks

Returns null if there is no data in the worksheet.

get(number, number)

Gets the Cell element at the specified cell row index and column index.

get(row: number, column: number) : Cell;

Parameters:

ParameterTypeDescription
rownumberRow index.
columnnumberColumn index.

Returns

The Cell object.

Example

const { Workbook } = require("aspose.cells.node");

var excel = new Workbook();
var cells = excel.worksheets.get(0).cells;
var cell = cells.get(0, 0);    //Gets the cell at "A1"

get(string)

Gets the Cell element at the specified cell name.

get(cellName: string) : Cell;

Parameters:

ParameterTypeDescription
cellNamestringCell name,including its column letter and row number, for example A5.

Returns

A Cell object

Example

const { Workbook } = require("aspose.cells.node");

var excel = new Workbook();
var cells = excel.worksheets.get(0).cells;
var cell = cells.get("A1");    //Gets the cell at "A1"

getOdsCellFields()

@deprecated. Please use the ‘odsCellFields’ property instead. Gets the list of fields of ods.

getOdsCellFields() : OdsCellFieldCollection;

Returns

OdsCellFieldCollection

getCount()

@deprecated. Please use the ‘count’ property instead. Gets the total count of instantiated Cell objects.

getCount() : number;

getCountLarge()

@deprecated. Please use the ‘countLarge’ property instead. Gets the total count of instantiated Cell objects.

getCountLarge() : number;

getRows()

@deprecated. Please use the ‘rows’ property instead. Gets the collection of Row objects that represents the individual rows in this worksheet.

getRows() : RowCollection;

Returns

RowCollection

getMultiThreadReading()

@deprecated. Please use the ‘multiThreadReading’ property instead. Gets or sets whether the cells data model should support Multi-Thread reading. Default value of this property is false.

getMultiThreadReading() : boolean;

Remarks

If there are multiple threads to read Row/Cell objects in this collection concurrently, this property should be set as true, otherwise unexpected result may be produced. Supporting Multi-Thread reading may degrade the performance for accessing Row/Cell objects from this collection. Please note, some features cannot support Multi-Thread reading, such as formatting values(by Cell.StringValue, Cell.DisplayStringValue, .etc.). So, even with this property being set as true, those APIs still may give unexpected result for Multi-Thread reading.

setMultiThreadReading(boolean)

@deprecated. Please use the ‘multiThreadReading’ property instead. Gets or sets whether the cells data model should support Multi-Thread reading. Default value of this property is false.

setMultiThreadReading(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

Remarks

If there are multiple threads to read Row/Cell objects in this collection concurrently, this property should be set as true, otherwise unexpected result may be produced. Supporting Multi-Thread reading may degrade the performance for accessing Row/Cell objects from this collection. Please note, some features cannot support Multi-Thread reading, such as formatting values(by Cell.StringValue, Cell.DisplayStringValue, .etc.). So, even with this property being set as true, those APIs still may give unexpected result for Multi-Thread reading.

getMemorySetting()

@deprecated. Please use the ‘memorySetting’ property instead. Gets or sets the memory usage option for this cells.

getMemorySetting() : MemorySetting;

Returns

MemorySetting

Remarks

Notable limits and recommended operations for some modes: Mode Remarks Supported MemorySetting.MemoryPreference Cells data will be maintained in compact format to decrease the memory cost. On other hand, the compact data also may cause higher time cost, especially when updating the cells data, or accessing cells/rows randomly v8.0.0 MemorySetting.FileCache When this mode is used for any worksheet in one workbook, Workbook.Dispose() should be called at the end of work to release all resources such as the temporary files.

Randomly accessing cells will give poor performance because data needs to be read/updated randomly and repeatedly(so the pointer in the file will be changed accordingly and IO operations will be required repeatedly). If possible, please always access the data sequentially(row by row).

When the data of one row/cell be changed, data of other cells/rows may also be influenced(such as the data be shifted/moved to other places to allocated enough spaces for the changed data). So every change of every data requires synchronization of other existing objects( such as Row or Cell object). So, to get better performance, please do not maintain multiple Rows/Cells at the same time. Processing them one by one will reduce the data synchronization for them so the performance can be improved a bit.
v25.7
</list

setMemorySetting(MemorySetting)

@deprecated. Please use the ‘memorySetting’ property instead. Gets or sets the memory usage option for this cells.

setMemorySetting(value: MemorySetting) : void;

Parameters:

ParameterTypeDescription
valueMemorySettingThe value to set.

Remarks

Notable limits and recommended operations for some modes: Mode Remarks Supported MemorySetting.MemoryPreference Cells data will be maintained in compact format to decrease the memory cost. On other hand, the compact data also may cause higher time cost, especially when updating the cells data, or accessing cells/rows randomly v8.0.0 MemorySetting.FileCache When this mode is used for any worksheet in one workbook, Workbook.Dispose() should be called at the end of work to release all resources such as the temporary files.

Randomly accessing cells will give poor performance because data needs to be read/updated randomly and repeatedly(so the pointer in the file will be changed accordingly and IO operations will be required repeatedly). If possible, please always access the data sequentially(row by row).

When the data of one row/cell be changed, data of other cells/rows may also be influenced(such as the data be shifted/moved to other places to allocated enough spaces for the changed data). So every change of every data requires synchronization of other existing objects( such as Row or Cell object). So, to get better performance, please do not maintain multiple Rows/Cells at the same time. Processing them one by one will reduce the data synchronization for them so the performance can be improved a bit.
v25.7
</list

getStyle()

@deprecated. Please use the ‘style’ property instead. Gets and sets the default style of the worksheet.

getStyle() : Style;

Returns

Style

setStyle(Style)

@deprecated. Please use the ‘style’ property instead. Gets and sets the default style of the worksheet.

setStyle(value: Style) : void;

Parameters:

ParameterTypeDescription
valueStyleThe value to set.

isDefaultColumnHidden()

@deprecated. Please use the ‘isDefaultColumnHidden’ property instead.

isDefaultColumnHidden() : boolean;

setIsDefaultColumnHidden(boolean)

@deprecated. Please use the ‘isDefaultColumnHidden’ property instead.

setIsDefaultColumnHidden(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getStandardWidthInch()

@deprecated. Please use the ‘standardWidthInch’ property instead. Gets or sets the default column width in the worksheet, in unit of inches.

getStandardWidthInch() : number;

setStandardWidthInch(number)

@deprecated. Please use the ‘standardWidthInch’ property instead. Gets or sets the default column width in the worksheet, in unit of inches.

setStandardWidthInch(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

getStandardWidthPixels()

@deprecated. Please use the ‘standardWidthPixels’ property instead. Gets or sets the default column width in the worksheet, in unit of pixels.

getStandardWidthPixels() : number;

setStandardWidthPixels(number)

@deprecated. Please use the ‘standardWidthPixels’ property instead. Gets or sets the default column width in the worksheet, in unit of pixels.

setStandardWidthPixels(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

getStandardWidth()

@deprecated. Please use the ‘standardWidth’ property instead. Gets or sets the default column width in the worksheet, in unit of characters.

getStandardWidth() : number;

setStandardWidth(number)

@deprecated. Please use the ‘standardWidth’ property instead. Gets or sets the default column width in the worksheet, in unit of characters.

setStandardWidth(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

getStandardHeight()

@deprecated. Please use the ‘standardHeight’ property instead. Gets or sets the default row height in this worksheet, in unit of points.

getStandardHeight() : number;

setStandardHeight(number)

@deprecated. Please use the ‘standardHeight’ property instead. Gets or sets the default row height in this worksheet, in unit of points.

setStandardHeight(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

getStandardHeightPixels()

@deprecated. Please use the ‘standardHeightPixels’ property instead. Gets or sets the default row height in this worksheet, in unit of pixels.

getStandardHeightPixels() : number;

setStandardHeightPixels(number)

@deprecated. Please use the ‘standardHeightPixels’ property instead. Gets or sets the default row height in this worksheet, in unit of pixels.

setStandardHeightPixels(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

getStandardHeightInch()

@deprecated. Please use the ‘standardHeightInch’ property instead. Gets or sets the default row height in this worksheet, in unit of inches.

getStandardHeightInch() : number;

setStandardHeightInch(number)

@deprecated. Please use the ‘standardHeightInch’ property instead. Gets or sets the default row height in this worksheet, in unit of inches.

setStandardHeightInch(value: number) : void;

Parameters:

ParameterTypeDescription
valuenumberThe value to set.

getPreserveString()

@deprecated. Please use the ‘preserveString’ property instead. Gets or sets a value indicating whether all worksheet values are preserved as strings. Default is false.

getPreserveString() : boolean;

setPreserveString(boolean)

@deprecated. Please use the ‘preserveString’ property instead. Gets or sets a value indicating whether all worksheet values are preserved as strings. Default is false.

setPreserveString(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getMinRow()

@deprecated. Please use the ‘minRow’ property instead. Minimum row index of cell which contains data or style.

getMinRow() : number;

Remarks

This property needs to iterate and check cells and rows dynamically, so it is a time-consumed progress and should not be invoked repeatedly, such as using it directly as condition in a loop.

getMaxRow()

@deprecated. Please use the ‘maxRow’ property instead. Maximum row index of cell which contains data or style.

getMaxRow() : number;

Remarks

Return -1 if there is no cell which contains data or style in the worksheet. This property needs to iterate and check cells and rows dynamically, so it is a time-consumed progress and should not be invoked repeatedly, such as using it directly as condition in a loop.

getMinColumn()

@deprecated. Please use the ‘minColumn’ property instead. Minimum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it).

getMinColumn() : number;

Remarks

This property needs to iterate and check cells and rows dynamically, so it is a time-consumed progress and should not be invoked repeatedly, such as using it directly as condition in a loop.

getMaxColumn()

@deprecated. Please use the ‘maxColumn’ property instead. Maximum column index of those cells that have been instantiated in the collection(does not include the column where style is defined for the whole column but no cell has been instantiated in it).

getMaxColumn() : number;

Remarks

Return -1 if there is no cell has been instantiated.

getMinDataRow()

@deprecated. Please use the ‘minDataRow’ property instead. Minimum row index of cell which contains data.

getMinDataRow() : number;

Remarks

Return -1 if there is no cell which contains data. This property needs to iterate and check cells and rows dynamically, so it is a time-consumed progress and should not be invoked repeatedly, such as using it directly as condition in a loop.

getMaxDataRow()

@deprecated. Please use the ‘maxDataRow’ property instead. Maximum row index of cell which contains data.

getMaxDataRow() : number;

Remarks

Return -1 if there is no cell which contains data. This property needs to iterate and check cells and rows dynamically, so it is a time-consumed progress and should not be invoked repeatedly, such as using it directly as condition in a loop.

getMinDataColumn()

@deprecated. Please use the ‘minDataColumn’ property instead. Minimum column index of cell which contains data.

getMinDataColumn() : number;

Remarks

-1 will be returned if there is no cell which contains data. This property needs to iterate and check all cells in a worksheet dynamically, so it is a time-consumed progress and should not be invoked repeatedly, such as using it directly as condition in a loop.

getMaxDataColumn()

@deprecated. Please use the ‘maxDataColumn’ property instead. Maximum column index of cell which contains data.

getMaxDataColumn() : number;

Remarks

-1 will be returned if there is no cell which contains data. This property needs to iterate and check all cells in a worksheet dynamically, so it is a time-consumed progress and should not be invoked repeatedly, such as using it directly as condition in a loop.

isDefaultRowHeightMatched()

@deprecated. Please use the ‘isDefaultRowHeightMatched’ property instead. Indicates that row height and default font height matches

isDefaultRowHeightMatched() : boolean;

setIsDefaultRowHeightMatched(boolean)

@deprecated. Please use the ‘isDefaultRowHeightMatched’ property instead. Indicates that row height and default font height matches

setIsDefaultRowHeightMatched(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

isDefaultRowHidden()

@deprecated. Please use the ‘isDefaultRowHidden’ property instead. Indicates whether the row is default hidden.

isDefaultRowHidden() : boolean;

setIsDefaultRowHidden(boolean)

@deprecated. Please use the ‘isDefaultRowHidden’ property instead. Indicates whether the row is default hidden.

setIsDefaultRowHidden(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

getColumns()

@deprecated. Please use the ‘columns’ property instead. Gets the collection of Column objects that represents the individual columns in this worksheet.

getColumns() : ColumnCollection;

Returns

ColumnCollection

getRanges()

@deprecated. Please use the ‘ranges’ property instead. Gets the collection of Range objects created at run time.

getRanges() : RangeCollection;

Returns

RangeCollection

getLastCell()

@deprecated. Please use the ’lastCell’ property instead. Gets the last cell in this worksheet.

getLastCell() : Cell;

Returns

Cell

Remarks

Returns null if there is no data in the worksheet.

getMaxDisplayRange()

@deprecated. Please use the ‘maxDisplayRange’ property instead. Gets the max range which includes data, merged cells and shapes.

getMaxDisplayRange() : Range;

Returns

Range

Remarks

Reutrns null if the worksheet is empty since Aspose.Cells 21.5.2.

getFirstCell()

@deprecated. Please use the ‘firstCell’ property instead. Gets the first cell in this worksheet.

getFirstCell() : Cell;

Returns

Cell

Remarks

Returns null if there is no data in the worksheet.

dispose()

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

dispose() : void;

getEnumerator()

Gets the cells enumerator.

getEnumerator() : CellEnumerator;

Returns

The cells enumerator

Remarks

When traversing elements by the returned Enumerator, the cells collection should not be modified(such as operations that will cause new Cell/Row be instantiated or existing Cell/Row be deleted). Otherwise the enumerator may not be able to traverse all cells correctly(some elements may be traversed repeatedly or skipped).

getMergedAreas()

Gets all merged cells.

getMergedAreas() : CellArea[];

Returns

CellArea[]

getCell(number, number)

Gets the Cell element or null at the specified cell row index and column index.

getCell(row: number, column: number) : Cell;

Parameters:

ParameterTypeDescription
rownumberRow index
columnnumberColumn index

Returns

Return Cell object if a Cell object exists. Return null if the cell does not exist.

Remarks

NOTE: This member is now obsolete. Instead, please use CheckCell(int row, int column) method. This method will be removed 12 months later since February 2024. Aspose apologizes for any inconvenience you may have experienced.

getRow(number)

Gets the Row element at the specified cell row index.

getRow(row: number) : Row;

Parameters:

ParameterTypeDescription
rownumberRow index

Returns

If the row object does exist return Row object, otherwise return null.

Remarks

NOTE: This member is now obsolete. Instead, please use Cells.CheckRow(int row) method. This method will be removed 12 months later since February 2024. Aspose apologizes for any inconvenience you may have experienced.

checkCell(number, number)

Gets the Cell element or null at the specified cell row index and column index.

checkCell(row: number, column: number) : Cell;

Parameters:

ParameterTypeDescription
rownumberRow index
columnnumberColumn index

Returns

Return Cell object if a Cell object exists. Return null if the cell does not exist.

checkRow(number)

Gets the Row element or null at the specified cell row index.

checkRow(row: number) : Row;

Parameters:

ParameterTypeDescription
rownumberRow index

Returns

Returns Row object If the row object does exist, otherwise returns null.

checkColumn(number)

Gets the Column element or null at the specified column index.

checkColumn(columnIndex: number) : Column;

Parameters:

ParameterTypeDescription
columnIndexnumberThe column index.

Returns

The Column object.

isRowHidden(number)

Checks whether a row at given index is hidden.

isRowHidden(rowIndex: number) : boolean;

Parameters:

ParameterTypeDescription
rowIndexnumberrow index

Returns

true if the row is hidden

isColumnHidden(number)

Checks whether a column at given index is hidden.

isColumnHidden(columnIndex: number) : boolean;

Parameters:

ParameterTypeDescription
columnIndexnumbercolumn index

Returns

true if the column is hidden.

addRange(Range)

Adds a range object reference to cells

addRange(rangeObject: Range) : void;

Parameters:

ParameterTypeDescription
rangeObjectRangeThe range object will be contained in the cells

createRange(string, string)

Creates a Range object from a range of cells.

createRange(upperLeftCell: string, lowerRightCell: string) : Range;

Parameters:

ParameterTypeDescription
upperLeftCellstringUpper left cell name.
lowerRightCellstringLower right cell name.

Returns

A Range object

createRange(number, number, number, number)

Creates a Range object from a range of cells.

createRange(firstRow: number, firstColumn: number, totalRows: number, totalColumns: number) : Range;

Parameters:

ParameterTypeDescription
firstRownumberFirst row of this range
firstColumnnumberFirst column of this range
totalRowsnumberNumber of rows
totalColumnsnumberNumber of columns

Returns

A Range object

createRange(string)

Creates a Range object from an address of the range.

createRange(address: string) : Range;

Parameters:

ParameterTypeDescription
addressstringThe address of the range.

Returns

A Range object

createRange(number, number, boolean)

Creates a Range object from rows of cells or columns of cells.

createRange(firstIndex: number, number: number, isVertical: boolean) : Range;

Parameters:

ParameterTypeDescription
firstIndexnumberFirst row index or first column index, zero based.
numbernumberTotal number of rows or columns, one based.
isVerticalbooleanTrue - Range created from columns of cells. False - Range created from rows of cells.

Returns

A Range object.

clear()

Clears all data of the worksheet.

clear() : void;

importFormulaArray(string[], number, number, boolean)

Imports an array of formula into a worksheet.

importFormulaArray(stringArray: string[], firstRow: number, firstColumn: number, isVertical: boolean) : void;

Parameters:

ParameterTypeDescription
stringArraystring[]Formula array.
firstRownumberThe row number of the first cell to import in.
firstColumnnumberThe column number of the first cell to import in.
isVerticalbooleanSpecifies to import data vertically or horizontally.

textToColumns(number, number, number, TxtLoadOptions)

Splits content in specified column into multiple columns..

textToColumns(row: number, column: number, totalRows: number, options: TxtLoadOptions) : number;

Parameters:

ParameterTypeDescription
rownumberThe row index.
columnnumberThe column index.
totalRowsnumberThe number of rows.
optionsTxtLoadOptionsThe split options.

Returns

Total column count of the split values.

importCSV(string, string, boolean, number, number)

Import a CSV file to the cells.

importCSV(fileName: string, splitter: string, convertNumericData: boolean, firstRow: number, firstColumn: number) : void;

Parameters:

ParameterTypeDescription
fileNamestringThe CSV file name.
splitterstringThe splitter
convertNumericDatabooleanWhether the string in text file is converted to numeric data.
firstRownumberThe row number of the first cell to import in.
firstColumnnumberThe column number of the first cell to import in.

importCSV(Uint8Array, string, boolean, number, number)

Import a CSV file to the cells.

importCSV(stream: Uint8Array, splitter: string, convertNumericData: boolean, firstRow: number, firstColumn: number) : void;

Parameters:

ParameterTypeDescription
streamUint8ArrayThe CSV file stream.
splitterstringThe splitter
convertNumericDatabooleanWhether the string in text file is converted to numeric data.
firstRownumberThe row number of the first cell to import in.
firstColumnnumberThe column number of the first cell to import in.

importCSV(string, TxtLoadOptions, number, number)

Import a CSV file to the cells.

importCSV(fileName: string, options: TxtLoadOptions, firstRow: number, firstColumn: number) : void;

Parameters:

ParameterTypeDescription
fileNamestringThe CSV file name.
optionsTxtLoadOptionsThe load options for reading text file
firstRownumberThe row number of the first cell to import in.
firstColumnnumberThe column number of the first cell to import in.

importCSV(Uint8Array, TxtLoadOptions, number, number)

Import a CSV file to the cells.

importCSV(stream: Uint8Array, options: TxtLoadOptions, firstRow: number, firstColumn: number) : void;

Parameters:

ParameterTypeDescription
streamUint8ArrayThe CSV file stream.
optionsTxtLoadOptionsThe load options for reading text file
firstRownumberThe row number of the first cell to import in.
firstColumnnumberThe column number of the first cell to import in.

importCSVAsync(string, string, boolean, number, number)

Import a CSV file to the cells.

importCSVAsync(fileName: string, splitter: string, convertNumericData: boolean, firstRow: number, firstColumn: number) : Promise<void>;

Parameters:

ParameterTypeDescription
fileNamestringThe CSV file name.
splitterstringThe splitter
convertNumericDatabooleanWhether the string in text file is converted to numeric data.
firstRownumberThe row number of the first cell to import in.
firstColumnnumberThe column number of the first cell to import in.

Returns

Promise

importCSVAsync(Uint8Array, string, boolean, number, number)

Import a CSV file to the cells.

importCSVAsync(stream: Uint8Array, splitter: string, convertNumericData: boolean, firstRow: number, firstColumn: number) : Promise<void>;

Parameters:

ParameterTypeDescription
streamUint8ArrayThe CSV file stream.
splitterstringThe splitter
convertNumericDatabooleanWhether the string in text file is converted to numeric data.
firstRownumberThe row number of the first cell to import in.
firstColumnnumberThe column number of the first cell to import in.

Returns

Promise

importCSVAsync(string, TxtLoadOptions, number, number)

Import a CSV file to the cells.

importCSVAsync(fileName: string, options: TxtLoadOptions, firstRow: number, firstColumn: number) : Promise<void>;

Parameters:

ParameterTypeDescription
fileNamestringThe CSV file name.
optionsTxtLoadOptionsThe load options for reading text file
firstRownumberThe row number of the first cell to import in.
firstColumnnumberThe column number of the first cell to import in.

Returns

Promise

importCSVAsync(Uint8Array, TxtLoadOptions, number, number)

Import a CSV file to the cells.

importCSVAsync(stream: Uint8Array, options: TxtLoadOptions, firstRow: number, firstColumn: number) : Promise<void>;

Parameters:

ParameterTypeDescription
streamUint8ArrayThe CSV file stream.
optionsTxtLoadOptionsThe load options for reading text file
firstRownumberThe row number of the first cell to import in.
firstColumnnumberThe column number of the first cell to import in.

Returns

Promise

merge(number, number, number, number)

Merges a specified range of cells into a single cell.

merge(firstRow: number, firstColumn: number, totalRows: number, totalColumns: number) : void;

Parameters:

ParameterTypeDescription
firstRownumberFirst row of this range(zero based)
firstColumnnumberFirst column of this range(zero based)
totalRowsnumberNumber of rows(one based)
totalColumnsnumberNumber of columns(one based)

Remarks

Reference the merged cell via the address of the upper-left cell in the range.

merge(number, number, number, number, boolean)

Merges a specified range of cells into a single cell.

merge(firstRow: number, firstColumn: number, totalRows: number, totalColumns: number, mergeConflict: boolean) : void;

Parameters:

ParameterTypeDescription
firstRownumberFirst row of this range(zero based)
firstColumnnumberFirst column of this range(zero based)
totalRowsnumberNumber of rows(one based)
totalColumnsnumberNumber of columns(one based)
mergeConflictbooleanMerge conflict merged ranges.

Remarks

Reference the merged cell via the address of the upper-left cell in the range. If mergeConflict is true and the merged range conflicts with other merged cells, other merged cells will be automatically removed.

merge(number, number, number, number, boolean, boolean)

Merges a specified range of cells into a single cell.

merge(firstRow: number, firstColumn: number, totalRows: number, totalColumns: number, checkConflict: boolean, mergeConflict: boolean) : void;

Parameters:

ParameterTypeDescription
firstRownumberFirst row of this range(zero based)
firstColumnnumberFirst column of this range(zero based)
totalRowsnumberNumber of rows(one based)
totalColumnsnumberNumber of columns(one based)
checkConflictbooleanIndicates whether check the merged cells intersects other merged cells
mergeConflictbooleanMerge conflict merged ranges.

Remarks

Reference the merged cell via the address of the upper-left cell in the range. If mergeConflict is true and the merged range conflicts with other merged cells, other merged cells will be automatically removed.

unMerge(number, number, number, number)

Unmerges a specified range of merged cells.

unMerge(firstRow: number, firstColumn: number, totalRows: number, totalColumns: number) : void;

Parameters:

ParameterTypeDescription
firstRownumberFirst row of this range(zero based)
firstColumnnumberFirst column of this range(zero based)
totalRowsnumberNumber of rows(one based)
totalColumnsnumberNumber of columns(one based)

clearMergedCells()

Clears all merged ranges.

clearMergedCells() : void;

hideRow(number)

Hides a row.

hideRow(row: number) : void;

Parameters:

ParameterTypeDescription
rownumberRow index.

unhideRow(number, number)

Unhides a row.

unhideRow(row: number, height: number) : void;

Parameters:

ParameterTypeDescription
rownumberRow index.
heightnumberRow height. The row’s height will be changed only when the row is hidden and given height value is positive.

hideRows(number, number)

Hides multiple rows.

hideRows(row: number, totalRows: number) : void;

Parameters:

ParameterTypeDescription
rownumberThe row index.
totalRowsnumberThe row number.

unhideRows(number, number, number)

Unhides the hidden rows.

unhideRows(row: number, totalRows: number, height: number) : void;

Parameters:

ParameterTypeDescription
rownumberThe row index.
totalRowsnumberThe row number.
heightnumberRow height. The row’s height will be changed only when the row is hidden and given height value is positive.

setRowHeightPixel(number, number)

Sets row height in unit of pixels.

setRowHeightPixel(row: number, pixels: number) : void;

Parameters:

ParameterTypeDescription
rownumberRow index.
pixelsnumberNumber of pixels.

setRowHeightInch(number, number)

Sets row height in unit of inches.

setRowHeightInch(row: number, inches: number) : void;

Parameters:

ParameterTypeDescription
rownumberRow index.
inchesnumberNumber of inches. It should be between 0 and 409.5/72.

setRowHeight(number, number)

Sets the height of the specified row.

setRowHeight(row: number, height: number) : void;

Parameters:

ParameterTypeDescription
rownumberRow index.
heightnumberHeight of row.In unit of point It should be between 0 and 409.5.

getRowHeight(number, boolean, CellsUnitType)

Gets row’s height.

getRowHeight(row: number, isOriginal: boolean, unitType: CellsUnitType) : number;

Parameters:

ParameterTypeDescription
rownumberThe row index.
isOriginalbooleanWhether returns the original row height or 0 for hidden row.
unitTypeCellsUnitTypeUnit type of the returned height value

Returns

Row’s height

getRowHeight(number)

Gets the height of a specified row, in unit of points.

getRowHeight(row: number) : number;

Parameters:

ParameterTypeDescription
rownumberRow index

Returns

Height of row

getRowOriginalHeightPoint(number)

Gets original row’s height in unit of point if the row is hidden

getRowOriginalHeightPoint(row: number) : number;

Parameters:

ParameterTypeDescription
rownumberThe row index.

Remarks

NOTE: This member is now obsolete. Instead, please use Cells.GetRowHeight(int,bool,CellsUnitType) method. This method will be removed 12 months later since April 2024. Aspose apologizes for any inconvenience you may have experienced.

getColumnWidth(number, boolean, CellsUnitType)

Gets the column width.

getColumnWidth(column: number, isOriginal: boolean, unitType: CellsUnitType) : number;

Parameters:

ParameterTypeDescription
columnnumberThe column index.
isOriginalbooleanIndicates whether getting original width.
unitTypeCellsUnitType

getColumnWidth(number)

Gets the width(in unit of characters) of the specified column in normal view

getColumnWidth(column: number) : number;

Parameters:

ParameterTypeDescription
columnnumberColumn index

Returns

Width of column. For spreadsheet, column width is measured as the number of characters of the maximum digit width of the numbers 0~9 as rendered in the normal style’s font.

getColumnOriginalWidthPoint(number)

Gets original column’s height in unit of point if the column is hidden

getColumnOriginalWidthPoint(column: number) : number;

Parameters:

ParameterTypeDescription
columnnumberThe row index.

Remarks

NOTE: This method is now obsolete. Instead, please use Cells.GetColumnWidth(int ,bool , CellsUnitType ) method. This method will be removed 12 months later since April 2024. Aspose apologizes for any inconvenience you may have experienced.

hideColumn(number)

Hides a column.

hideColumn(column: number) : void;

Parameters:

ParameterTypeDescription
columnnumberColumn index.

unhideColumn(number, number)

Unhides a column

unhideColumn(column: number, width: number) : void;

Parameters:

ParameterTypeDescription
columnnumberColumn index.
widthnumberColumn width.

hideColumns(number, number)

Hide multiple columns.

hideColumns(column: number, totalColumns: number) : void;

Parameters:

ParameterTypeDescription
columnnumberColumn index.
totalColumnsnumberColumn number.

unhideColumns(number, number, number)

Unhide multiple columns.

unhideColumns(column: number, totalColumns: number, width: number) : void;

Parameters:

ParameterTypeDescription
columnnumberColumn index.
totalColumnsnumberColumn number
widthnumberColumn width.

Remarks

Only applies the column width to the hidden columns.

getViewRowHeight(number)

Gets the height of a specified row.

getViewRowHeight(row: number) : number;

Parameters:

ParameterTypeDescription
rownumberRow index.

Returns

Height of row.

getRowHeightInch(number)

Gets the height of a specified row in unit of inches.

getRowHeightInch(row: number) : number;

Parameters:

ParameterTypeDescription
rownumberRow index

Returns

Height of row

getViewRowHeightInch(number)

Gets the height of a specified row in unit of inches.

getViewRowHeightInch(row: number) : number;

Parameters:

ParameterTypeDescription
rownumberRow index

Returns

Height of row

getRowHeightPixel(number)

Gets the height of a specified row in unit of pixel.

getRowHeightPixel(row: number) : number;

Parameters:

ParameterTypeDescription
rownumberRow index

Returns

Height of row

setColumnWidthPixel(number, number)

Sets column width in unit of pixels in normal view.

setColumnWidthPixel(column: number, pixels: number) : void;

Parameters:

ParameterTypeDescription
columnnumberColumn index.
pixelsnumberNumber of pixels.

setColumnWidthInch(number, number)

Sets column width in unit of inches in normal view.

setColumnWidthInch(column: number, inches: number) : void;

Parameters:

ParameterTypeDescription
columnnumberColumn index.
inchesnumberNumber of inches.

setColumnWidth(number, number)

Sets the width of the specified column in normal view.

setColumnWidth(column: number, width: number) : void;

Parameters:

ParameterTypeDescription
columnnumberColumn index.
widthnumberWidth of column in unit of characters.Column width must be between 0 and 255.

Remarks

For spreadsheet, column width is measured as the number of characters of the maximum digit width of the numbers 0~9 as rendered in the normal style’s font.

getColumnWidthPixel(number)

Gets the width of the specified column in normal view, in units of pixel.

getColumnWidthPixel(column: number) : number;

Parameters:

ParameterTypeDescription
columnnumberColumn index

Returns

Width of column in normal view.

getColumnWidthPixel(number, boolean)

Gets the width of the specified column in normal view, in units of pixel.

getColumnWidthPixel(column: number, original: boolean) : number;

Parameters:

ParameterTypeDescription
columnnumberColumn index
originalbooleanIndicates whether returning original width even when the column is hidden

Returns

Width of column in normal view.

Remarks

NOTE: This method is now obsolete. Instead, please use Cells.GetColumnWidth(int ,bool , CellsUnitType ) method. This method will be removed 12 months later since April 2024. Aspose apologizes for any inconvenience you may have experienced.

getColumnWidthInch(number)

Gets the width of the specified column in normal view, in units of inches.

getColumnWidthInch(column: number) : number;

Parameters:

ParameterTypeDescription
columnnumberColumn index

Returns

Width of column

Remarks

NOTE: This method is now obsolete. Instead, please use Cells.GetColumnWidth(int ,bool , CellsUnitType ) method. This method will be removed 12 months later since April 2024. Aspose apologizes for any inconvenience you may have experienced.

getViewColumnWidthPixel(number)

Get the width in different view type.

getViewColumnWidthPixel(column: number) : number;

Parameters:

ParameterTypeDescription
columnnumberThe column index.

Returns

the column width in unit of pixels

setViewColumnWidthPixel(number, number)

Sets the width of the column in different view.

setViewColumnWidthPixel(column: number, pixels: number) : void;

Parameters:

ParameterTypeDescription
columnnumberThe column index.
pixelsnumberThe width in unit of pixels.

Remarks

If the current view type is ViewType.PageLayoutView, the column’s width is same as printed width.

getLastDataRow(number)

Gets the last row index of cell which contains data in the specified column.

getLastDataRow(column: number) : number;

Parameters:

ParameterTypeDescription
columnnumberColumn index.

Returns

last row index.

getFirstDataRow(number)

Gets the first row index of cell which contains data in the specified column.

getFirstDataRow(column: number) : number;

Parameters:

ParameterTypeDescription
columnnumberColumn index.

Returns

first row index.

applyColumnStyle(number, Style, StyleFlag)

Applies formats for a whole column.

applyColumnStyle(column: number, style: Style, flag: StyleFlag) : void;

Parameters:

ParameterTypeDescription
columnnumberThe column index.
styleStyleThe style object which will be applied.
flagStyleFlagFlags which indicates applied formatting properties.

applyRowStyle(number, Style, StyleFlag)

Applies formats for a whole row.

applyRowStyle(row: number, style: Style, flag: StyleFlag) : void;

Parameters:

ParameterTypeDescription
rownumberThe row index.
styleStyleThe style object which will be applied.
flagStyleFlagFlags which indicates applied formatting properties.

applyStyle(Style, StyleFlag)

Applies formats for a whole worksheet.

applyStyle(style: Style, flag: StyleFlag) : void;

Parameters:

ParameterTypeDescription
styleStyleThe style object which will be applied.
flagStyleFlagFlags which indicates applied formatting properties.

copyColumns(Cells, number, number, number, PasteOptions)

Copies data and formats of a whole column.

copyColumns(sourceCells: Cells, sourceColumnIndex: number, destinationColumnIndex: number, columnNumber: number, pasteOptions: PasteOptions) : void;

Parameters:

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceColumnIndexnumberSource column index.
destinationColumnIndexnumberDestination column index.
columnNumbernumberThe copied column number.
pasteOptionsPasteOptionsthe options of pasting.

copyColumns(Cells, number, number, number)

Copies data and formats of whole columns.

copyColumns(sourceCells: Cells, sourceColumnIndex: number, destinationColumnIndex: number, columnNumber: number) : void;

Parameters:

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceColumnIndexnumberSource column index.
destinationColumnIndexnumberDestination column index.
columnNumbernumberThe copied column number.

copyColumns(Cells, number, number, number, number)

Copies data and formats of the whole columns.

copyColumns(sourceCells: Cells, sourceColumnIndex: number, sourceTotalColumns: number, destinationColumnIndex: number, destinationTotalColumns: number) : void;

Parameters:

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceColumnIndexnumberSource column index.
sourceTotalColumnsnumberThe number of the source columns.
destinationColumnIndexnumberDestination column index.
destinationTotalColumnsnumberThe number of the destination columns.

copyColumn(Cells, number, number)

Copies data and formats of a whole column.

copyColumn(sourceCells: Cells, sourceColumnIndex: number, destinationColumnIndex: number) : void;

Parameters:

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceColumnIndexnumberSource column index.
destinationColumnIndexnumberDestination column index.

copyRow(Cells, number, number)

Copies data and formats of a whole row.

copyRow(sourceCells: Cells, sourceRowIndex: number, destinationRowIndex: number) : void;

Parameters:

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceRowIndexnumberSource row index.
destinationRowIndexnumberDestination row index.

copyRows(Cells, number, number, number)

Copies data and formats of some whole rows.

copyRows(sourceCells: Cells, sourceRowIndex: number, destinationRowIndex: number, rowNumber: number) : void;

Parameters:

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceRowIndexnumberSource row index.
destinationRowIndexnumberDestination row index.
rowNumbernumberThe copied row number.

copyRows(Cells, number, number, number, CopyOptions)

Copies data and formats of some whole rows.

copyRows(sourceCells: Cells, sourceRowIndex: number, destinationRowIndex: number, rowNumber: number, copyOptions: CopyOptions) : void;

Parameters:

ParameterTypeDescription
sourceCellsCellsSource Cells object contains data and formats to copy.
sourceRowIndexnumberSource row index.
destinationRowIndexnumberDestination row index.
rowNumbernumberThe copied row number.
copyOptionsCopyOptionsThe copy options.

copyRows(Cells, number, number, number, CopyOptions, PasteOptions)

Copies data and formats of some whole rows.

copyRows(sourceCells0: Cells, sourceRowIndex: number, destinationRowIndex: number, rowNumber: number, copyOptions: CopyOptions, pasteOptions: PasteOptions) : void;

Parameters:

ParameterTypeDescription
sourceCells0CellsSource Cells object contains data and formats to copy.
sourceRowIndexnumberSource row index.
destinationRowIndexnumberDestination row index.
rowNumbernumberThe copied row number.
copyOptionsCopyOptionsThe copy options.
pasteOptionsPasteOptionsthe options of pasting.

getGroupedRowOutlineLevel(number)

Gets the outline level (zero-based) of the row.

getGroupedRowOutlineLevel(rowIndex: number) : number;

Parameters:

ParameterTypeDescription
rowIndexnumberThe row index.

Returns

The outline level (zero-based) of the row.

Remarks

If the row is not grouped, returns zero.

getGroupedColumnOutlineLevel(number)

Gets the outline level (zero-based) of the column.

getGroupedColumnOutlineLevel(columnIndex: number) : number;

Parameters:

ParameterTypeDescription
columnIndexnumberThe column index

Returns

The outline level of the column

Remarks

If the column is not grouped, returns zero.

getMaxGroupedColumnOutlineLevel()

Gets the max grouped column outline level (zero-based).

getMaxGroupedColumnOutlineLevel() : number;

Returns

The max grouped column outline level (zero-based)

getMaxGroupedRowOutlineLevel()

Gets the max grouped row outline level (zero-based).

getMaxGroupedRowOutlineLevel() : number;

Returns

The max grouped row outline level (zero-based)

showGroupDetail(boolean, number)

Expands the grouped rows/columns.

showGroupDetail(isVertical: boolean, index: number) : void;

Parameters:

ParameterTypeDescription
isVerticalbooleanTrue, expands the grouped rows.
indexnumberThe row/column index

hideGroupDetail(boolean, number)

Collapses the grouped rows/columns.

hideGroupDetail(isVertical: boolean, index: number) : void;

Parameters:

ParameterTypeDescription
isVerticalbooleanTrue, collapse the grouped rows.
indexnumberThe row/column index

ungroupColumns(number, number)

Ungroups columns.

ungroupColumns(firstIndex: number, lastIndex: number) : void;

Parameters:

ParameterTypeDescription
firstIndexnumberThe first column index to be ungrouped.
lastIndexnumberThe last column index to be ungrouped.

groupColumns(number, number)

Groups columns.

groupColumns(firstIndex: number, lastIndex: number) : void;

Parameters:

ParameterTypeDescription
firstIndexnumberThe first column index to be grouped.
lastIndexnumberThe last column index to be grouped.

groupColumns(number, number, boolean)

Groups columns.

groupColumns(firstIndex: number, lastIndex: number, isHidden: boolean) : void;

Parameters:

ParameterTypeDescription
firstIndexnumberThe first column index to be grouped.
lastIndexnumberThe last column index to be grouped.
isHiddenbooleanSpecifies if the grouped columns are hidden.

ungroupRows(number, number, boolean)

Ungroups rows.

ungroupRows(firstIndex: number, lastIndex: number, isAll: boolean) : void;

Parameters:

ParameterTypeDescription
firstIndexnumberThe first row index to be ungrouped.
lastIndexnumberThe last row index to be ungrouped.
isAllbooleanTrue, removes all grouped info.Otherwise, remove the outer group info.

ungroupRows(number, number)

Ungroups rows.

ungroupRows(firstIndex: number, lastIndex: number) : void;

Parameters:

ParameterTypeDescription
firstIndexnumberThe first row index to be ungrouped.
lastIndexnumberThe last row index to be ungrouped.

Remarks

Only removes outer group info.

groupRows(number, number, boolean)

Groups rows.

groupRows(firstIndex: number, lastIndex: number, isHidden: boolean) : void;

Parameters:

ParameterTypeDescription
firstIndexnumberThe first row index to be grouped.
lastIndexnumberThe last row index to be grouped.
isHiddenbooleanSpecifies if the grouped rows are hidden.

groupRows(number, number)

Groups rows.

groupRows(firstIndex: number, lastIndex: number) : void;

Parameters:

ParameterTypeDescription
firstIndexnumberThe first row index to be grouped.
lastIndexnumberThe last row index to be grouped.

deleteColumn(number, boolean)

Deletes a column.

deleteColumn(columnIndex: number, updateReference: boolean) : void;

Parameters:

ParameterTypeDescription
columnIndexnumberIndex of the column to be deleted.
updateReferencebooleanIndicates whether update references in other worksheets.

deleteColumn(number)

Deletes a column.

deleteColumn(columnIndex: number) : void;

Parameters:

ParameterTypeDescription
columnIndexnumberIndex of the column to be deleted.

deleteColumns(number, number, boolean)

Deletes several columns.

deleteColumns(columnIndex: number, totalColumns: number, updateReference: boolean) : void;

Parameters:

ParameterTypeDescription
columnIndexnumberIndex of the first column to be deleted.
totalColumnsnumberCount of columns to be deleted.
updateReferencebooleanIndicates whether update references in other worksheets.

deleteColumns(number, number, DeleteOptions)

Deletes several columns.

deleteColumns(columnIndex: number, totalColumns: number, options: DeleteOptions) : void;

Parameters:

ParameterTypeDescription
columnIndexnumberIndex of the first column to be deleted.
totalColumnsnumberCount of columns to be deleted.
optionsDeleteOptionsOptions for the deleting operation

isDeletingRangeEnabled(number, number, number, number)

Check whether the range could be deleted.

isDeletingRangeEnabled(startRow: number, startColumn: number, totalRows: number, totalColumns: number) : boolean;

Parameters:

ParameterTypeDescription
startRownumberThe start row index of the range.
startColumnnumberThe start column index of the range.
totalRowsnumberThe number of the rows in the range.
totalColumnsnumberThe number of the columns in the range.

deleteRow(number)

Deletes a row.

deleteRow(rowIndex: number) : void;

Parameters:

ParameterTypeDescription
rowIndexnumberIndex of the row to be deleted.

deleteRow(number, boolean)

Deletes a row.

deleteRow(rowIndex: number, updateReference: boolean) : void;

Parameters:

ParameterTypeDescription
rowIndexnumberIndex of the row to be deleted.
updateReferencebooleanIndicates whether update references in other worksheets.

deleteRows(number, number)

Deletes multiple rows.

deleteRows(rowIndex: number, totalRows: number) : boolean;

Parameters:

ParameterTypeDescription
rowIndexnumberThe first row index to be deleted.
totalRowsnumberCount of rows to be deleted.

Remarks

If the deleted range contains the top part(not whole) of the table(ListObject), the ranged could not be deleted and nothing will be done. It works in the same way with MS Excel.

deleteRows(number, number, boolean)

Deletes multiple rows in the worksheet.

deleteRows(rowIndex: number, totalRows: number, updateReference: boolean) : boolean;

Parameters:

ParameterTypeDescription
rowIndexnumberIndex of the first row to be deleted.
totalRowsnumberCount of rows to be deleted.
updateReferencebooleanIndicates whether update references in other worksheets.

deleteRows(number, number, DeleteOptions)

Deletes multiple rows in the worksheet.

deleteRows(rowIndex: number, totalRows: number, options: DeleteOptions) : boolean;

Parameters:

ParameterTypeDescription
rowIndexnumberIndex of the first row to be deleted.
totalRowsnumberCount of rows to be deleted.
optionsDeleteOptionsOptions for the deleting operation

deleteBlankColumns()

Delete all blank columns which do not contain any data.

deleteBlankColumns() : void;

deleteBlankColumns(DeleteOptions)

Delete all blank columns which do not contain any data.

deleteBlankColumns(options: DeleteOptions) : void;

Parameters:

ParameterTypeDescription
optionsDeleteOptionsThe options of deleting range.

isBlankColumn(number)

Checks whether given column is blank(does not contain any data).

isBlankColumn(columnIndex: number) : boolean;

Parameters:

ParameterTypeDescription
columnIndexnumberthe column index

Returns

true if given column does not contain any data

deleteBlankRows()

Delete all blank rows which do not contain any data or other object.

deleteBlankRows() : void;

deleteBlankRows(DeleteOptions)

Delete all blank rows which do not contain any data or some special objects such as visible comment, pivot table.

deleteBlankRows(options: DeleteOptions) : void;

Parameters:

ParameterTypeDescription
optionsDeleteOptionsThe options of deleting range.

Remarks

For blank rows that will be deleted, it is not only required that Row.IsBlank should be true, but also there should be no visible comment defined for any cell in those rows, and no pivot table whose range intersects with them.

insertColumns(number, number)

Inserts some columns into the worksheet.

insertColumns(columnIndex: number, totalColumns: number) : void;

Parameters:

ParameterTypeDescription
columnIndexnumberColumn index.
totalColumnsnumberThe number of columns.

insertColumns(number, number, boolean)

Inserts some columns into the worksheet.

insertColumns(columnIndex: number, totalColumns: number, updateReference: boolean) : void;

Parameters:

ParameterTypeDescription
columnIndexnumberColumn index.
totalColumnsnumberThe number of columns.
updateReferencebooleanIndicates if references in other worksheets will be updated.

insertColumns(number, number, InsertOptions)

Inserts some columns into the worksheet.

insertColumns(columnIndex: number, totalColumns: number, options: InsertOptions) : void;

Parameters:

ParameterTypeDescription
columnIndexnumberColumn index.
totalColumnsnumberThe number of columns.
optionsInsertOptionsThe options for inserting operation.

insertColumn(number, boolean)

Inserts a new column into the worksheet.

insertColumn(columnIndex: number, updateReference: boolean) : void;

Parameters:

ParameterTypeDescription
columnIndexnumberColumn index.
updateReferencebooleanIndicates if references in other worksheets will be updated.

insertColumn(number)

Inserts a new column into the worksheet.

insertColumn(columnIndex: number) : void;

Parameters:

ParameterTypeDescription
columnIndexnumberColumn index.

insertRows(number, number, boolean)

Inserts multiple rows into the worksheet.

insertRows(rowIndex: number, totalRows: number, updateReference: boolean) : void;

Parameters:

ParameterTypeDescription
rowIndexnumberRow index.
totalRowsnumberNumber of rows to be inserted.
updateReferencebooleanIndicates if references in other worksheets will be updated.

insertRows(number, number, InsertOptions)

Inserts multiple rows into the worksheet.

insertRows(rowIndex: number, totalRows: number, options: InsertOptions) : void;

Parameters:

ParameterTypeDescription
rowIndexnumberRow index.
totalRowsnumberNumber of rows to be inserted.
optionsInsertOptionsOptions for inserting operation.

insertRows(number, number)

Inserts multiple rows into the worksheet.

insertRows(rowIndex: number, totalRows: number) : void;

Parameters:

ParameterTypeDescription
rowIndexnumberRow index.
totalRowsnumberNumber of rows to be inserted.

insertRow(number)

Inserts a new row into the worksheet.

insertRow(rowIndex: number) : void;

Parameters:

ParameterTypeDescription
rowIndexnumberRow index.

clearRange(CellArea)

Clears contents and formatting of a range.

clearRange(range: CellArea) : void;

Parameters:

ParameterTypeDescription
rangeCellAreaRange to be cleared.

clearRange(number, number, number, number)

Clears contents and formatting of a range.

clearRange(startRow: number, startColumn: number, endRow: number, endColumn: number) : void;

Parameters:

ParameterTypeDescription
startRownumberStart row index.
startColumnnumberStart column index.
endRownumberEnd row index.
endColumnnumberEnd column index.

clearContents(CellArea)

Clears contents of a range.

clearContents(range: CellArea) : void;

Parameters:

ParameterTypeDescription
rangeCellAreaRange to be cleared.

clearContents(number, number, number, number)

Clears contents of a range.

clearContents(startRow: number, startColumn: number, endRow: number, endColumn: number) : void;

Parameters:

ParameterTypeDescription
startRownumberStart row index.
startColumnnumberStart column index.
endRownumberEnd row index.
endColumnnumberEnd column index.

clearFormats(CellArea)

Clears formatting of a range.

clearFormats(range: CellArea) : void;

Parameters:

ParameterTypeDescription
rangeCellAreaRange to be cleared.

clearFormats(number, number, number, number)

Clears formatting of a range.

clearFormats(startRow: number, startColumn: number, endRow: number, endColumn: number) : void;

Parameters:

ParameterTypeDescription
startRownumberStart row index.
startColumnnumberStart column index.
endRownumberEnd row index.
endColumnnumberEnd column index.

linkToXmlMap(string, number, number, string)

Link to a xml map.

linkToXmlMap(mapName: string, row: number, column: number, path: string) : void;

Parameters:

ParameterTypeDescription
mapNamestringname of xml map
rownumberrow of the destination cell
columnnumbercolumn of the destination cell
pathstringpath of xml element in xml map

find(Object, Cell)

Finds the cell containing with the input object.

find(what: Object, previousCell: Cell) : Cell;

Parameters:

ParameterTypeDescription
whatObjectThe object to search for. /// The type should be int,double,DateTime,string,bool.
previousCellCellPrevious cell with the same object. /// This parameter can be set to null if searching from the start.

Returns

Cell object.

Remarks

Returns null (Nothing) if no cell is found.

find(Object, Cell, FindOptions)

Finds the cell containing with the input object.

find(what: Object, previousCell: Cell, findOptions: FindOptions) : Cell;

Parameters:

ParameterTypeDescription
whatObjectThe object to search for. /// The type should be int,double,DateTime,string,bool.
previousCellCellPrevious cell with the same object. /// This parameter can be set to null if searching from the start.
findOptionsFindOptionsFind options

Returns

Cell object.

Remarks

Returns null (Nothing) if no cell is found.

endCellInRow(number)

Gets the last cell in this row.

endCellInRow(rowIndex: number) : Cell;

Parameters:

ParameterTypeDescription
rowIndexnumberRow index.

Returns

Cell object.

endCellInRow(number, number, number, number)

Gets the last cell with maximum row index in this range.

endCellInRow(startRow: number, endRow: number, startColumn: number, endColumn: number) : Cell;

Parameters:

ParameterTypeDescription
startRownumberStart row index.
endRownumberEnd row index.
startColumnnumberStart column index.
endColumnnumberEnd column index.

Returns

Cell object.

endCellInColumn(number)

Gets the last cell in this column.

endCellInColumn(columnIndex: number) : Cell;

Parameters:

ParameterTypeDescription
columnIndexnumberColumn index.

Returns

Cell object.

endCellInColumn(number, number, number, number)

Gets the last cell with maximum column index in this range.

endCellInColumn(startRow: number, endRow: number, startColumn: number, endColumn: number) : Cell;

Parameters:

ParameterTypeDescription
startRownumberStart row index.
endRownumberEnd row index.
startColumnnumberStart column index.
endColumnnumberEnd column index.

Returns

Cell object.

moveRange(CellArea, number, number)

Moves the range.

moveRange(sourceArea: CellArea, destRow: number, destColumn: number) : void;

Parameters:

ParameterTypeDescription
sourceAreaCellAreaThe range which should be moved.
destRownumberThe dest row.
destColumnnumberThe dest column.

insertCutCells(Range, number, number, ShiftType)

Insert cut range.

insertCutCells(cutRange: Range, row: number, column: number, shiftType: ShiftType) : void;

Parameters:

ParameterTypeDescription
cutRangeRangeThe cut range.
rownumberThe row.
columnnumberThe column.
shiftTypeShiftTypeIndicates how to shift other objects of the target range when inserting cut range.

insertRange(CellArea, number, ShiftType, boolean)

Inserts a range of cells and shift cells according to the shift option.

insertRange(area: CellArea, shiftNumber: number, shiftType: ShiftType, updateReference: boolean) : void;

Parameters:

ParameterTypeDescription
areaCellAreaShift area.
shiftNumbernumberNumber of rows or columns to be inserted.
shiftTypeShiftTypeShift cells option.
updateReferencebooleanIndicates whether update references in other worksheets.

insertRange(CellArea, ShiftType)

Inserts a range of cells and shift cells according to the shift option.

insertRange(area: CellArea, shiftType: ShiftType) : void;

Parameters:

ParameterTypeDescription
areaCellAreaShift area.
shiftTypeShiftTypeShift cells option.

insertRange(CellArea, number, ShiftType)

Inserts a range of cells and shift cells according to the shift option.

insertRange(area: CellArea, shiftNumber: number, shiftType: ShiftType) : void;

Parameters:

ParameterTypeDescription
areaCellAreaShift area.
shiftNumbernumberNumber of rows or columns to be inserted.
shiftTypeShiftTypeShift cells option.

deleteRange(number, number, number, number, ShiftType)

Deletes a range of cells and shift cells according to the shift option.

deleteRange(startRow: number, startColumn: number, endRow: number, endColumn: number, shiftType: ShiftType) : void;

Parameters:

ParameterTypeDescription
startRownumberStart row index.
startColumnnumberStart column index.
endRownumberEnd row index.
endColumnnumberEnd column index.
shiftTypeShiftTypeShift cells option.

exportArray(number, number, number, number)

Exports data in the Cells collection to a two-dimension array object.

exportArray(firstRow: number, firstColumn: number, totalRows: number, totalColumns: number) : Object[][];

Parameters:

ParameterTypeDescription
firstRownumberThe row number of the first cell to export out.
firstColumnnumberThe column number of the first cell to export out.
totalRowsnumberNumber of rows to be exported
totalColumnsnumberNumber of columns to be exported

Returns

Exported cell value array object.

retrieveSubtotalSetting(CellArea)

Retrieves subtotals setting of the range.

retrieveSubtotalSetting(ca: CellArea) : SubtotalSetting;

Parameters:

ParameterTypeDescription
caCellAreaThe range

Returns

SubtotalSetting

subtotal(CellArea, number, ConsolidationFunction, number[])

Creates subtotals for the range.

subtotal(ca: CellArea, groupBy: number, consolidationFunction: ConsolidationFunction, totalList: number[]) : void;

Parameters:

ParameterTypeDescription
caCellAreaThe range
groupBynumberThe field to group by, as a zero-based integer offset
consolidationFunctionConsolidationFunctionThe subtotal function.
totalListnumber[]An array of zero-based field offsets, indicating the fields to which the subtotals are added.

subtotal(CellArea, number, ConsolidationFunction, number[], boolean, boolean, boolean)

Creates subtotals for the range.

subtotal(ca: CellArea, groupBy: number, consolidationFunction: ConsolidationFunction, totalList: number[], replace: boolean, pageBreaks: boolean, summaryBelowData: boolean) : void;

Parameters:

ParameterTypeDescription
caCellAreaThe range
groupBynumberThe field to group by, as a zero-based integer offset
consolidationFunctionConsolidationFunctionThe subtotal function.
totalListnumber[]An array of zero-based field offsets, indicating the fields to which the subtotals are added.
replacebooleanIndicates whether replace the current subtotals
pageBreaksbooleanIndicates whether add page break between groups
summaryBelowDatabooleanIndicates whether add summary below data.

removeFormulas()

Removes all formula and replaces with the value of the formula.

removeFormulas() : void;

removeDuplicates()

Removes duplicate rows in the sheet.

removeDuplicates() : void;

removeDuplicates(number, number, number, number)

Removes duplicate values in the range.

removeDuplicates(startRow: number, startColumn: number, endRow: number, endColumn: number) : void;

Parameters:

ParameterTypeDescription
startRownumberThe start row.
startColumnnumberThe start column
endRownumberThe end row index.
endColumnnumberThe end column index.

removeDuplicates(number, number, number, number, boolean, number[])

Removes duplicate data of the range.

removeDuplicates(startRow: number, startColumn: number, endRow: number, endColumn: number, hasHeaders: boolean, columnOffsets: number[]) : void;

Parameters:

ParameterTypeDescription
startRownumberThe start row.
startColumnnumberThe start column
endRownumberThe end row index.
endColumnnumberThe end column index.
hasHeadersbooleanIndicates whether the range contains headers.
columnOffsetsnumber[]The column offsets.

convertStringToNumericValue()

Converts all string data in the worksheet to numeric value if possible.

convertStringToNumericValue() : void;

getDependents(boolean, number, number)

Get all cells which refer to the specific cell.

getDependents(isAll: boolean, row: number, column: number) : Cell[];

Parameters:

ParameterTypeDescription
isAllbooleanIndicates whether check other worksheets
rownumberThe row index.
columnnumberThe column index.

Returns

Cell[]

getDependentsInCalculation(number, number, boolean)

Gets all cells whose calculated result depends on specific cell.

getDependentsInCalculation(row: number, column: number, recursive: boolean) : CellEnumerator;

Parameters:

ParameterTypeDescription
rownumberRow index of the specific cell
columnnumberColumn index of the specific cell.
recursivebooleanWhether returns those dependents which do not reference to the specific cell directly /// but reference to other leafs of that cell.

Returns

Enumerator to enumerate all dependents(Cell objects)

Remarks

To use this method, please make sure the workbook has been set with true value for FormulaSettings.EnableCalculationChain and has been fully calculated with this setting. If there is no formula reference to this cell, null will be returned. For more details and example, please see Cell.GetDependentsInCalculation(bool)

getCellsWithPlaceInCellPicture()

Gets all cells that contain embedded picture.

getCellsWithPlaceInCellPicture() : CellEnumerator;

Returns

Enumerator to enumerate all Cell objects that contain embedded picture

Remarks

If there is no picture which is set as “Place in Cell” in this worksheet, null will be returned.

getCellStyle(number, number)

Get the style of given cell.

getCellStyle(row: number, column: number) : Style;

Parameters:

ParameterTypeDescription
rownumberrow index
columnnumbercolumn

Returns

the style of given cell.

Remarks

The returned style is only the one set for the cell or inherited from the row/column of the cell, does not include the applied properties by other settings such as conditional formattings.

getCellDisplayStyle(number, number)

Get the display style of given cell.

getCellDisplayStyle(row: number, column: number) : Style;

Parameters:

ParameterTypeDescription
rownumberrow index of given cell
columnnumbercolumn of given cell

Returns

the display style of given cell.

Remarks

Same with Cell.GetDisplayStyle(), and same with using BorderType.SideBorders for [GetCellDisplayStyle(int, int, BorderType)](../getcelldisplaystyle(int, int, bordertype)/).

getCellDisplayStyle(number, number, BorderType)

Get the display style of given cell.

getCellDisplayStyle(row: number, column: number, adjacentBorders: BorderType) : Style;

Parameters:

ParameterTypeDescription
rownumberrow index of given cell
columnnumbercolumn of given cell
adjacentBordersBorderTypeIndicates which borders need to be checked and adjusted according to the borders of adjacent cells. /// Please see the description for the same parameter of /// Cell.GetDisplayStyle(BorderType).

Returns

the display style of given cell.

Remarks

If the cell is also affected by other settings such as conditional formatting, list objects, etc., then the display style may be different from [GetCellStyle(int, int)](../getcellstyle(int, int)/). And because those settings also may be applied to empty(non-existing) cells, using this method can avoid the instantiation of those empty cells so the performance will be better than getting the Cell instance from Cells and then calling Cell.GetDisplayStyle(BorderType).

isNull()

Checks whether the implementation object is null.

isNull() : boolean;