Class Cells
Namespace: Aspose.Cells
Assembly: Aspose.Cells.dll (25.2.0)
Encapsulates a collection of cell relevant objects, such as Aspose.Cells.Cell, Aspose.Cells.Row, …etc.
public class Cells : IEnumerable, IDisposable
Inheritance
Implements
Inherited Members
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Examples
Workbook excel = new Workbook();
Cells cells = excel.Worksheets[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);
//Put values to cells
cells[0, 0].PutValue(true);
cells[0, 1].PutValue(1);
cells[0, 2].PutValue("abc");
//Export data
object[,] arr = cells.ExportArray(0, 0, 10, 10);
Dim excel as Workbook = new Workbook()
Dim cells as Cells = excel.Worksheets(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)
'Export data
Dim outDataTable as DataTable = cells.ExportDataTable(12, 12, 10, 10)
Properties
Columns
Gets the collection of Aspose.Cells.Column objects that represents the individual columns in this worksheet.
public ColumnCollection Columns { get; }
Property Value
Count
Gets the total count of instantiated Cell objects.
public int Count { get; }
Property Value
CountLarge
Gets the total count of instantiated Cell objects.
public long CountLarge { get; }
Property Value
FirstCell
Gets the first cell in this worksheet.
public Cell FirstCell { get; }
Property Value
Remarks
Returns null if there is no data in the worksheet.
IsDefaultRowHeightMatched
Indicates that row height and default font height matches
public bool IsDefaultRowHeightMatched { get; set; }
Property Value
IsDefaultRowHidden
Indicates whether the row is default hidden.
public bool IsDefaultRowHidden { get; set; }
Property Value
LastCell
Gets the last cell in this worksheet.
public Cell LastCell { get; }
Property Value
Remarks
Returns null if there is no data in the worksheet.
MaxColumn
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).
public int MaxColumn { get; }
Property Value
Remarks
Return -1 if there is no cell has been instantiated.
MaxDataColumn
Maximum column index of cell which contains data.
public int MaxDataColumn { get; }
Property Value
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, so it is a time-consumed progress and should not be invoked repeatedly.
MaxDataRow
Maximum row index of cell which contains data.
public int MaxDataRow { get; }
Property Value
Remarks
Return -1 if there is no cell which contains data.
MaxDisplayRange
Gets the max range which includes data, merged cells and shapes.
public Range MaxDisplayRange { get; }
Property Value
Remarks
Reutrns null if the worksheet is empty since Aspose.Cells 21.5.2.
MaxRow
Maximum row index of cell which contains data or style.
public int MaxRow { get; }
Property Value
Remarks
Return -1 if there is no cell which contains data or style in the worksheet.
MemorySetting
Gets or sets the memory usage option for this cells.
public MemorySetting MemorySetting { get; set; }
Property Value
MinColumn
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).
public int MinColumn { get; }
Property Value
MinDataColumn
Minimum column index of cell which contains data.
public int MinDataColumn { get; }
Property Value
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, so it is a time-consumed progress and should not be invoked repeatedly.
MinDataRow
Minimum row index of cell which contains data.
public int MinDataRow { get; }
Property Value
Remarks
Return -1 if there is no cell which contains data.
MinRow
Minimum row index of cell which contains data or style.
public int MinRow { get; }
Property Value
MultiThreadReading
Gets or sets whether the cells data model should support Multi-Thread reading. Default value of this property is false.
public bool MultiThreadReading { get; set; }
Property Value
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 Aspose.Cells.Cell.StringValue, Aspose.Cells.Cell.DisplayStringValue, .etc.). So, even with this property being set as true, those APIs still may give unexpected result for Multi-Thread reading.
OdsCellFields
Gets the list of fields of ods.
public OdsCellFieldCollection OdsCellFields { get; }
Property Value
PreserveString
Gets or sets a value indicating whether all worksheet values are preserved as strings. Default is false.
public bool PreserveString { get; set; }
Property Value
Ranges
Gets the collection of Aspose.Cells.Range objects created at run time.
public RangeCollection Ranges { get; }
Property Value
Rows
Gets the collection of Aspose.Cells.Row objects that represents the individual rows in this worksheet.
public RowCollection Rows { get; }
Property Value
StandardHeight
Gets or sets the default row height in this worksheet, in unit of points.
public double StandardHeight { get; set; }
Property Value
StandardHeightInch
Gets or sets the default row height in this worksheet, in unit of inches.
public double StandardHeightInch { get; set; }
Property Value
StandardHeightPixels
Gets or sets the default row height in this worksheet, in unit of pixels.
public int StandardHeightPixels { get; set; }
Property Value
StandardWidth
Gets or sets the default column width in the worksheet, in unit of characters.
public double StandardWidth { get; set; }
Property Value
StandardWidthInch
Gets or sets the default column width in the worksheet, in unit of inches.
public double StandardWidthInch { get; set; }
Property Value
StandardWidthPixels
Gets or sets the default column width in the worksheet, in unit of pixels.
public int StandardWidthPixels { get; set; }
Property Value
Style
Gets and sets the default style of the worksheet.
public Style Style { get; set; }
Property Value
this[int, int]
Gets the Aspose.Cells.Cell element at the specified cell row index and column index.
public Cell this[int row, int column] { get; }
Property Value
Examples
Workbook excel = new Workbook();
Cells cells = excel.Worksheets[0].Cells;
Cell cell = cells[0, 0]; //Gets the cell at "A1"
Dim excel as Workbook = New Workbook()
Dim cells As Cells = excel.Worksheets(0).Cells
Dim cell As Cell = cells(0,0) 'Gets the cell at "A1"
this[string]
Gets the Aspose.Cells.Cell element at the specified cell name.
public Cell this[string cellName] { get; }
Property Value
Examples
Workbook excel = new Workbook();
Cells cells = excel.Worksheets[0].Cells;
Cell cell = cells["A1"]; //Gets the cell at "A1"
Dim excel as Workbook = New Workbook()
Dim cells As Cells = excel.Worksheets(0).Cells
Dim cell As Cell = cells("A1") 'Gets the cell at "A1"
Methods
AddRange(Range)
Adds a range object reference to cells
public void AddRange(Range rangeObject)
Parameters
rangeObject
Range
The range object will be contained in the cells
ApplyColumnStyle(int, Style, StyleFlag)
Applies formats for a whole column.
public void ApplyColumnStyle(int column, Style style, StyleFlag flag)
Parameters
column
int
The column index.
style
Style
The style object which will be applied.
flag
StyleFlag
Flags which indicates applied formatting properties.
ApplyRowStyle(int, Style, StyleFlag)
Applies formats for a whole row.
public void ApplyRowStyle(int row, Style style, StyleFlag flag)
Parameters
row
int
The row index.
style
Style
The style object which will be applied.
flag
StyleFlag
Flags which indicates applied formatting properties.
ApplyStyle(Style, StyleFlag)
Applies formats for a whole worksheet.
public void ApplyStyle(Style style, StyleFlag flag)
Parameters
style
Style
The style object which will be applied.
flag
StyleFlag
Flags which indicates applied formatting properties.
CheckCell(int, int)
Gets the Aspose.Cells.Cell element or null at the specified cell row index and column index.
public Cell CheckCell(int row, int column)
Parameters
row
int
Row index
column
int
Column index
Returns
Return Cell object if a Cell object exists. Return null if the cell does not exist.
CheckColumn(int)
Gets the Aspose.Cells.Column element or null at the specified column index.
public Column CheckColumn(int columnIndex)
Parameters
columnIndex
int
The column index.
Returns
The Column object.
CheckRow(int)
Gets the Aspose.Cells.Row element or null at the specified cell row index.
public Row CheckRow(int row)
Parameters
row
int
Row index
Returns
Returns Aspose.Cells.Row object If the row object does exist, otherwise returns null.
Clear()
Clears all data of the worksheet.
public void Clear()
ClearContents(CellArea)
Clears contents of a range.
public void ClearContents(CellArea range)
Parameters
range
CellArea
Range to be cleared.
ClearContents(int, int, int, int)
Clears contents of a range.
public void ClearContents(int startRow, int startColumn, int endRow, int endColumn)
Parameters
startRow
int
Start row index.
startColumn
int
Start column index.
endRow
int
End row index.
endColumn
int
End column index.
ClearFormats(CellArea)
Clears formatting of a range.
public void ClearFormats(CellArea range)
Parameters
range
CellArea
Range to be cleared.
ClearFormats(int, int, int, int)
Clears formatting of a range.
public void ClearFormats(int startRow, int startColumn, int endRow, int endColumn)
Parameters
startRow
int
Start row index.
startColumn
int
Start column index.
endRow
int
End row index.
endColumn
int
End column index.
ClearMergedCells()
Clears all merged ranges.
public void ClearMergedCells()
ClearRange(CellArea)
Clears contents and formatting of a range.
public void ClearRange(CellArea range)
Parameters
range
CellArea
Range to be cleared.
ClearRange(int, int, int, int)
Clears contents and formatting of a range.
public void ClearRange(int startRow, int startColumn, int endRow, int endColumn)
Parameters
startRow
int
Start row index.
startColumn
int
Start column index.
endRow
int
End row index.
endColumn
int
End column index.
ConvertStringToNumericValue()
Converts all string data in the worksheet to numeric value if possible.
public void ConvertStringToNumericValue()
CopyColumn(Cells, int, int)
Copies data and formats of a whole column.
public void CopyColumn(Cells sourceCells, int sourceColumnIndex, int destinationColumnIndex)
Parameters
sourceCells
Cells
Source Cells object contains data and formats to copy.
sourceColumnIndex
int
Source column index.
destinationColumnIndex
int
Destination column index.
CopyColumns(Cells, int, int, int, PasteOptions)
Copies data and formats of a whole column.
public void CopyColumns(Cells sourceCells0, int sourceColumnIndex, int destinationColumnIndex, int columnNumber, PasteOptions pasteOptions)
Parameters
sourceCells0
Cells
Source Cells object contains data and formats to copy.
sourceColumnIndex
int
Source column index.
destinationColumnIndex
int
Destination column index.
columnNumber
int
The copied column number.
pasteOptions
PasteOptions
the options of pasting.
CopyColumns(Cells, int, int, int)
Copies data and formats of a whole column.
public void CopyColumns(Cells sourceCells0, int sourceColumnIndex, int destinationColumnIndex, int columnNumber)
Parameters
sourceCells0
Cells
Source Cells object contains data and formats to copy.
sourceColumnIndex
int
Source column index.
destinationColumnIndex
int
Destination column index.
columnNumber
int
The copied column number.
CopyColumns(Cells, int, int, int, int)
Copies data and formats of the whole columns.
public void CopyColumns(Cells sourceCells, int sourceColumnIndex, int sourceTotalColumns, int destinationColumnIndex, int destinationTotalColumns)
Parameters
sourceCells
Cells
Source Cells object contains data and formats to copy.
sourceColumnIndex
int
Source column index.
sourceTotalColumns
int
The number of the source columns.
destinationColumnIndex
int
Destination column index.
destinationTotalColumns
int
The number of the destination columns.
CopyRow(Cells, int, int)
Copies data and formats of a whole row.
public void CopyRow(Cells sourceCells, int sourceRowIndex, int destinationRowIndex)
Parameters
sourceCells
Cells
Source Cells object contains data and formats to copy.
sourceRowIndex
int
Source row index.
destinationRowIndex
int
Destination row index.
CopyRows(Cells, int, int, int)
Copies data and formats of some whole rows.
public void CopyRows(Cells sourceCells, int sourceRowIndex, int destinationRowIndex, int rowNumber)
Parameters
sourceCells
Cells
Source Cells object contains data and formats to copy.
sourceRowIndex
int
Source row index.
destinationRowIndex
int
Destination row index.
rowNumber
int
The copied row number.
CopyRows(Cells, int, int, int, CopyOptions)
Copies data and formats of some whole rows.
public void CopyRows(Cells sourceCells0, int sourceRowIndex, int destinationRowIndex, int rowNumber, CopyOptions copyOptions)
Parameters
sourceCells0
Cells
Source Cells object contains data and formats to copy.
sourceRowIndex
int
Source row index.
destinationRowIndex
int
Destination row index.
rowNumber
int
The copied row number.
copyOptions
CopyOptions
The copy options.
CopyRows(Cells, int, int, int, CopyOptions, PasteOptions)
Copies data and formats of some whole rows.
public void CopyRows(Cells sourceCells0, int sourceRowIndex, int destinationRowIndex, int rowNumber, CopyOptions copyOptions, PasteOptions pasteOptions)
Parameters
sourceCells0
Cells
Source Cells object contains data and formats to copy.
sourceRowIndex
int
Source row index.
destinationRowIndex
int
Destination row index.
rowNumber
int
The copied row number.
copyOptions
CopyOptions
The copy options.
pasteOptions
PasteOptions
the options of pasting.
CreateRange(string, string)
Creates a Aspose.Cells.Range object from a range of cells.
public Range CreateRange(string upperLeftCell, string lowerRightCell)
Parameters
upperLeftCell
string
Upper left cell name.
lowerRightCell
string
Lower right cell name.
Returns
A Aspose.Cells.Range object
CreateRange(int, int, int, int)
Creates a Aspose.Cells.Range object from a range of cells.
public Range CreateRange(int firstRow, int firstColumn, int totalRows, int totalColumns)
Parameters
firstRow
int
First row of this range
firstColumn
int
First column of this range
totalRows
int
Number of rows
totalColumns
int
Number of columns
Returns
A Aspose.Cells.Range object
CreateRange(string)
Creates a Aspose.Cells.Range object from an address of the range.
public Range CreateRange(string address)
Parameters
address
string
The address of the range.
Returns
A Aspose.Cells.Range object
CreateRange(int, int, bool)
Creates a Aspose.Cells.Range object from rows of cells or columns of cells.
public Range CreateRange(int firstIndex, int number, bool isVertical)
Parameters
firstIndex
int
First row index or first column index, zero based.
number
int
Total number of rows or columns, one based.
isVertical
bool
True - Range created from columns of cells. False - Range created from rows of cells.
Returns
A Aspose.Cells.Range object.
DeleteBlankColumns()
Delete all blank columns which do not contain any data.
public void DeleteBlankColumns()
DeleteBlankColumns(DeleteOptions)
Delete all blank columns which do not contain any data.
public void DeleteBlankColumns(DeleteOptions options)
Parameters
options
DeleteOptions
The options of deleting range.
DeleteBlankRows()
Delete all blank rows which do not contain any data or other object.
public void DeleteBlankRows()
DeleteBlankRows(DeleteOptions)
Delete all blank rows which do not contain any data or some special objects such as visible comment, pivot table.
public void DeleteBlankRows(DeleteOptions options)
Parameters
options
DeleteOptions
The options of deleting range.
Remarks
For blank rows that will be deleted, it is not only required that Aspose.Cells.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.
DeleteColumn(int, bool)
Deletes a column.
public void DeleteColumn(int columnIndex, bool updateReference)
Parameters
columnIndex
int
Index of the column to be deleted.
updateReference
bool
Indicates whether update references in other worksheets.
DeleteColumn(int)
Deletes a column.
public void DeleteColumn(int columnIndex)
Parameters
columnIndex
int
Index of the column to be deleted.
DeleteColumns(int, int, bool)
Deletes several columns.
public void DeleteColumns(int columnIndex, int totalColumns, bool updateReference)
Parameters
columnIndex
int
Index of the first column to be deleted.
totalColumns
int
Count of columns to be deleted.
updateReference
bool
Indicates whether update references in other worksheets.
DeleteColumns(int, int, DeleteOptions)
Deletes several columns.
public void DeleteColumns(int columnIndex, int totalColumns, DeleteOptions options)
Parameters
columnIndex
int
Index of the first column to be deleted.
totalColumns
int
Count of columns to be deleted.
options
DeleteOptions
Options for the deleting operation
DeleteRange(int, int, int, int, ShiftType)
Deletes a range of cells and shift cells according to the shift option.
public void DeleteRange(int startRow, int startColumn, int endRow, int endColumn, ShiftType shiftType)
Parameters
startRow
int
Start row index.
startColumn
int
Start column index.
endRow
int
End row index.
endColumn
int
End column index.
shiftType
ShiftType
Shift cells option.
DeleteRow(int)
Deletes a row.
public void DeleteRow(int rowIndex)
Parameters
rowIndex
int
Index of the row to be deleted.
DeleteRow(int, bool)
Deletes a row.
public void DeleteRow(int rowIndex, bool updateReference)
Parameters
rowIndex
int
Index of the row to be deleted.
updateReference
bool
Indicates whether update references in other worksheets.
DeleteRows(int, int)
Deletes multiple rows.
public bool DeleteRows(int rowIndex, int totalRows)
Parameters
rowIndex
int
The first row index to be deleted.
totalRows
int
Count of rows to be deleted.
Returns
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(int, int, bool)
Deletes multiple rows in the worksheet.
public bool DeleteRows(int rowIndex, int totalRows, bool updateReference)
Parameters
rowIndex
int
Index of the first row to be deleted.
totalRows
int
Count of rows to be deleted.
updateReference
bool
Indicates whether update references in other worksheets.
Returns
DeleteRows(int, int, DeleteOptions)
Deletes multiple rows in the worksheet.
public bool DeleteRows(int rowIndex, int totalRows, DeleteOptions options)
Parameters
rowIndex
int
Index of the first row to be deleted.
totalRows
int
Count of rows to be deleted.
options
DeleteOptions
Options for the deleting operation
Returns
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
EndCellInColumn(short)
Gets the last cell in this column.
public Cell EndCellInColumn(short columnIndex)
Parameters
columnIndex
short
Column index.
Returns
Cell object.
EndCellInColumn(int, int, short, short)
Gets the last cell with maximum column index in this range.
public Cell EndCellInColumn(int startRow, int endRow, short startColumn, short endColumn)
Parameters
startRow
int
Start row index.
endRow
int
End row index.
startColumn
short
Start column index.
endColumn
short
End column index.
Returns
Cell object.
EndCellInRow(int)
Gets the last cell in this row.
public Cell EndCellInRow(int rowIndex)
Parameters
rowIndex
int
Row index.
Returns
Cell object.
EndCellInRow(int, int, int, int)
Gets the last cell with maximum row index in this range.
public Cell EndCellInRow(int startRow, int endRow, int startColumn, int endColumn)
Parameters
startRow
int
Start row index.
endRow
int
End row index.
startColumn
int
Start column index.
endColumn
int
End column index.
Returns
Cell object.
ExportArray(int, int, int, int)
Exports data in the Aspose.Cells.Cells collection to a two-dimension array object.
public object[,] ExportArray(int firstRow, int firstColumn, int totalRows, int totalColumns)
Parameters
firstRow
int
The row number of the first cell to export out.
firstColumn
int
The column number of the first cell to export out.
totalRows
int
Number of rows to be exported
totalColumns
int
Number of columns to be exported
Returns
object[,]
Exported cell value array object.
ExportDataTable(int, int, int, int)
Exports data in the Aspose.Cells.Cells collection to a System.Data.DataTable object.
public DataTable ExportDataTable(int firstRow, int firstColumn, int totalRows, int totalColumns)
Parameters
firstRow
int
The row number of the first cell to export out.
firstColumn
int
The column number of the first cell to export out.
totalRows
int
Number of rows to be imported.
totalColumns
int
Number of columns to be imported.
Returns
Exported System.Data.DataTable object.
Examples
string designerFile = "List.xls";
Workbook excel = new Workbook(designerFile);
Worksheet sheet = excel.Worksheets[0];
DataTable dt = sheet.Cells.ExportDataTable(6, 1, 69, 4);
Dim designerFile As String = "List.xls"
Dim excel As excel = New excel(designerFile)
Dim sheet As Worksheet = excel.Worksheets(0)
Dim dt As DataTable = sheet.Cells.ExportDataTable(6, 1, 69, 4)
Remarks
If you use this method to export a block of data, please be sure that the data in a column should be the same data type. Otherwise, use the Aspose.Cells.Cells.ExportDataTableAsString(System.Int32,System.Int32,System.Int32,System.Int32) method instead.
ExportDataTable(int, int, int, int, bool)
Exports data in the Aspose.Cells.Cells collection to a System.Data.DataTable object.
public DataTable ExportDataTable(int firstRow, int firstColumn, int totalRows, int totalColumns, bool exportColumnName)
Parameters
firstRow
int
The row number of the first cell to export out.
firstColumn
int
The column number of the first cell to export out.
totalRows
int
Number of rows to be imported.
totalColumns
int
Number of columns to be imported.
exportColumnName
bool
Indicates whether the data in the first row are exported to the column name of the DataTable.
Returns
Exported System.Data.DataTable object.
ExportDataTable(int, int, int, int, ExportTableOptions)
Exports data in the Aspose.Cells.Cells collection to a System.Data.DataTable object.
public DataTable ExportDataTable(int firstRow, int firstColumn, int totalRows, int totalColumns, ExportTableOptions options)
Parameters
firstRow
int
The row number of the first cell to export out.
firstColumn
int
The column number of the first cell to export out.
totalRows
int
Number of rows to be imported.
totalColumns
int
Number of columns to be imported.
options
ExportTableOptions
All export table options
Returns
Exported System.Data.DataTable object.
ExportDataTableAsString(int, int, int, int)
Exports data in the Aspose.Cells.Cells collection to a System.Data.DataTable object.
public DataTable ExportDataTableAsString(int firstRow, int firstColumn, int totalRows, int totalColumns)
Parameters
firstRow
int
The row number of the first cell to export out.
firstColumn
int
The column number of the first cell to export out.
totalRows
int
Number of rows to be imported.
totalColumns
int
Number of columns to be imported.
Returns
Exported System.Data.DataTable object.
Remarks
All data in the Aspose.Cells.Cells collection are converted to strings.
ExportDataTableAsString(int, int, int, int, bool)
Exports data in the Aspose.Cells.Cells collection to a System.Data.DataTable object.
public DataTable ExportDataTableAsString(int firstRow, int firstColumn, int totalRows, int totalColumns, bool exportColumnName)
Parameters
firstRow
int
The row number of the first cell to export out.
firstColumn
int
The column number of the first cell to export out.
totalRows
int
Number of rows to be imported.
totalColumns
int
Number of columns to be imported.
exportColumnName
bool
Indicates whether the data in the first row are exported to the column name of the DataTable.
Returns
Exported System.Data.DataTable object.
Remarks
All data in the Aspose.Cells.Cells collection are converted to strings.
ExportList<t>(int, int, int, int, ExportTableOptions)
public List<t> ExportList<t>(int firstRow, int firstColumn, int totalRows, int totalColumns, ExportTableOptions options)
Parameters
firstRow
int
firstColumn
int
totalRows
int
totalColumns
int
options
ExportTableOptions
Returns
List<t>
Type Parameters
T
ExportTypeArray(int, int, int, int)
Exports cell value type in the Aspose.Cells.Cells collection to a two-dimension array object.
public CellValueType[,] ExportTypeArray(int firstRow, int firstColumn, int totalRows, int totalColumns)
Parameters
firstRow
int
The row number of the first cell to export out.
firstColumn
int
The column number of the first cell to export out.
totalRows
int
Number of rows to be exported.
totalColumns
int
Number of columns to be exported.
Returns
Exported array object representing cell value types.
Find(object, Cell)
Finds the cell containing with the input object.
public Cell Find(object what, Cell previousCell)
Parameters
what
object
The object to search for. The type should be int,double,DateTime,string,bool.
previousCell
Cell
Previous 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.
public Cell Find(object what, Cell previousCell, FindOptions findOptions)
Parameters
what
object
The object to search for. The type should be int,double,DateTime,string,bool.
previousCell
Cell
Previous cell with the same object. This parameter can be set to null if searching from the start.
findOptions
FindOptions
Find options
Returns
Cell object.
Remarks
Returns null (Nothing) if no cell is found.
GetCell(int, int)
Gets the Aspose.Cells.Cell element or null at the specified cell row index and column index.
[Obsolete("Use Cells.CheckCell(int row, int column) instead.")]
public Cell GetCell(int row, int column)
Parameters
row
int
Row index
column
int
Column 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.
GetCellStyle(int, int)
Get the style of given cell.
public Style GetCellStyle(int row, int column)
Parameters
row
int
row index
column
int
column
Returns
the style of given cell.
GetCellsWithPlaceInCellPicture()
Gets all cells that contain embedded picture.
public IEnumerator GetCellsWithPlaceInCellPicture()
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.
GetColumnWidth(int, bool, CellsUnitType)
Gets the column width.
public double GetColumnWidth(int column, bool isOriginal, CellsUnitType unitType)
Parameters
column
int
The column index.
isOriginal
bool
Indicates whether getting original width.
unitType
CellsUnitType
Returns
GetColumnWidth(int)
Gets the width(in unit of characters) of the specified column in normal view
public double GetColumnWidth(int column)
Parameters
column
int
Column 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.
GetColumnWidthPixel(int)
Gets the width of the specified column in normal view, in units of pixel.
public int GetColumnWidthPixel(int column)
Parameters
column
int
Column index
Returns
Width of column in normal view.
GetDependents(bool, int, int)
Get all cells which refer to the specific cell.
public Cell[] GetDependents(bool isAll, int row, int column)
Parameters
isAll
bool
Indicates whether check other worksheets
row
int
The row index.
column
int
The column index.
Returns
Cell[]
GetDependentsInCalculation(int, int, bool)
Gets all cells whose calculated result depends on specific cell.
public IEnumerator GetDependentsInCalculation(int row, int column, bool recursive)
Parameters
row
int
Row index of the specific cell
column
int
Column index of the specific cell.
recursive
bool
Whether 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 Aspose.Cells.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 Aspose.Cells.Cell.GetDependentsInCalculation(System.Boolean)
GetEnumerator()
Gets the cells enumerator.
public IEnumerator GetEnumerator()
Returns
The cells enumerator
Examples
Workbook workbook = new Workbook("template.xlsx");
Cells cells = workbook.Worksheets[0].Cells;
IEnumerator en = cells.GetEnumerator();
while (en.MoveNext())
{
Cell cell = (Cell)en.Current;
Console.WriteLine(cell.Name + ": " + cell.Value);
}</code></pre>
#### 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).
### <a id="Aspose_Cells_Cells_GetGroupedColumnOutlineLevel_System_Int32_"></a> GetGroupedColumnOutlineLevel\(int\)
Gets the outline level (zero-based) of the column.
```csharp
public int GetGroupedColumnOutlineLevel(int columnIndex)
Parameters
columnIndex
int
The column index
Returns
The outline level of the column
Remarks
If the column is not grouped, returns zero.
GetGroupedRowOutlineLevel(int)
Gets the outline level (zero-based) of the row.
public int GetGroupedRowOutlineLevel(int rowIndex)
Parameters
rowIndex
int
The row index.
Returns
The outline level (zero-based) of the row.
Remarks
If the row is not grouped, returns zero.
GetLastDataRow(int)
Gets the last row index of cell which contains data in the specified column.
public int GetLastDataRow(int column)
Parameters
column
int
Column index.
Returns
last row index.
GetMaxGroupedColumnOutlineLevel()
Gets the max grouped column outline level (zero-based).
public int GetMaxGroupedColumnOutlineLevel()
Returns
The max grouped column outline level (zero-based)
GetMaxGroupedRowOutlineLevel()
Gets the max grouped row outline level (zero-based).
public int GetMaxGroupedRowOutlineLevel()
Returns
The max grouped row outline level (zero-based)
GetMergedAreas()
Gets all merged cells.
public CellArea[] GetMergedAreas()
Returns
CellArea[]
GetRow(int)
Gets the Aspose.Cells.Row element at the specified cell row index.
[Obsolete("Use Cells.CheckRow(int row) instead.")]
public Row GetRow(int row)
Parameters
row
int
Row 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.
GetRowHeight(int, bool, CellsUnitType)
Gets row’s height.
public double GetRowHeight(int row, bool isOriginal, CellsUnitType unitType)
Parameters
row
int
The row index.
isOriginal
bool
Whether returns the original row height or 0 for hidden row.
unitType
CellsUnitType
Unit type of the returned height value
Returns
Row’s height
GetRowHeight(int)
Gets the height of a specified row, in unit of points.
public double GetRowHeight(int row)
Parameters
row
int
Row index
Returns
Height of row
GetRowHeightInch(int)
Gets the height of a specified row in unit of inches.
public double GetRowHeightInch(int row)
Parameters
row
int
Row index
Returns
Height of row
GetRowHeightPixel(int)
Gets the height of a specified row in unit of pixel.
public int GetRowHeightPixel(int row)
Parameters
row
int
Row index
Returns
Height of row
GetViewColumnWidthPixel(int)
Get the width in different view type.
public int GetViewColumnWidthPixel(int column)
Parameters
column
int
The column index.
Returns
the column width in unit of pixels
GetViewRowHeight(int)
Gets the height of a specified row.
public double GetViewRowHeight(int row)
Parameters
row
int
Row index.
Returns
Height of row.
GetViewRowHeightInch(int)
Gets the height of a specified row in unit of inches.
public double GetViewRowHeightInch(int row)
Parameters
row
int
Row index
Returns
Height of row
GroupColumns(int, int)
Groups columns.
public void GroupColumns(int firstIndex, int lastIndex)
Parameters
firstIndex
int
The first column index to be grouped.
lastIndex
int
The last column index to be grouped.
GroupColumns(int, int, bool)
Groups columns.
public void GroupColumns(int firstIndex, int lastIndex, bool isHidden)
Parameters
firstIndex
int
The first column index to be grouped.
lastIndex
int
The last column index to be grouped.
isHidden
bool
Specifies if the grouped columns are hidden.
GroupRows(int, int, bool)
Groups rows.
public void GroupRows(int firstIndex, int lastIndex, bool isHidden)
Parameters
firstIndex
int
The first row index to be grouped.
lastIndex
int
The last row index to be grouped.
isHidden
bool
Specifies if the grouped rows are hidden.
GroupRows(int, int)
Groups rows.
public void GroupRows(int firstIndex, int lastIndex)
Parameters
firstIndex
int
The first row index to be grouped.
lastIndex
int
The last row index to be grouped.
HideColumn(int)
Hides a column.
public void HideColumn(int column)
Parameters
column
int
Column index.
HideColumns(int, int)
Hide multiple columns.
public void HideColumns(int column, int totalColumns)
Parameters
column
int
Column index.
totalColumns
int
Column number.
HideGroupDetail(bool, int)
Collapses the grouped rows/columns.
public void HideGroupDetail(bool isVertical, int index)
Parameters
isVertical
bool
True, collapse the grouped rows.
index
int
The row/column index
HideRow(int)
Hides a row.
public void HideRow(int row)
Parameters
row
int
Row index.
HideRows(int, int)
Hides multiple rows.
public void HideRows(int row, int totalRows)
Parameters
row
int
The row index.
totalRows
int
The row number.
ImportArray(string[,], int, int)
Imports a two-dimension array of string into a worksheet.
public void ImportArray(string[,] stringArray, int firstRow, int firstColumn)
Parameters
stringArray
string[,]
Two-dimension string array.
firstRow
int
The row number of the first cell to import in.
firstColumn
int
The column number of the first cell to import in.
ImportArray(string[], int, int, bool)
Imports an array of string into a worksheet.
public void ImportArray(string[] stringArray, int firstRow, int firstColumn, bool isVertical)
Parameters
stringArray
string[]
String array.
firstRow
int
The row number of the first cell to import in.
firstColumn
int
The column number of the first cell to import in.
isVertical
bool
Specifies to import data vertically or horizontally.
ImportArray(int[,], int, int)
Imports a two-dimension array of integer into a worksheet.
public void ImportArray(int[,] intArray, int firstRow, int firstColumn)
Parameters
intArray
int[,]
Two-dimension integer array.
firstRow
int
The row number of the first cell to import in.
firstColumn
int
The column number of the first cell to import in.
ImportArray(int[], int, int, bool)
Imports an array of integer into a worksheet.
public void ImportArray(int[] intArray, int firstRow, int firstColumn, bool isVertical)
Parameters
intArray
int[]
Integer array.
firstRow
int
The row number of the first cell to import in.
firstColumn
int
The column number of the first cell to import in.
isVertical
bool
Specifies to import data vertically or horizontally.
ImportArray(double[,], int, int)
Imports a two-dimension array of double into a worksheet.
public void ImportArray(double[,] doubleArray, int firstRow, int firstColumn)
Parameters
doubleArray
double[,]
Two-dimension double array.
firstRow
int
The row number of the first cell to import in.
firstColumn
int
The column number of the first cell to import in.
ImportArray(double[], int, int, bool)
Imports an array of double into a worksheet.
public void ImportArray(double[] doubleArray, int firstRow, int firstColumn, bool isVertical)
Parameters
doubleArray
double[]
Double array.
firstRow
int
The row number of the first cell to import in.
firstColumn
int
The column number of the first cell to import in.
isVertical
bool
Specifies to import data vertically or horizontally.
ImportArrayList(ArrayList, int, int, bool)
Imports an arraylist of data into a worksheet.
public void ImportArrayList(ArrayList arrayList, int firstRow, int firstColumn, bool isVertical)
Parameters
arrayList
ArrayList
Data arraylist.
firstRow
int
The row number of the first cell to import in.
firstColumn
int
The column number of the first cell to import in.
isVertical
bool
Specifies to import data vertically or horizontally.
ImportCSV(string, string, bool, int, int)
Import a CSV file to the cells.
public void ImportCSV(string fileName, string splitter, bool convertNumericData, int firstRow, int firstColumn)
Parameters
fileName
string
The CSV file name.
splitter
string
The splitter
convertNumericData
bool
Whether the string in text file is converted to numeric data.
firstRow
int
The row number of the first cell to import in.
firstColumn
int
The column number of the first cell to import in.
ImportCSV(Stream, string, bool, int, int)
Import a CSV file to the cells.
public void ImportCSV(Stream stream, string splitter, bool convertNumericData, int firstRow, int firstColumn)
Parameters
stream
Stream
The CSV file stream.
splitter
string
The splitter
convertNumericData
bool
Whether the string in text file is converted to numeric data.
firstRow
int
The row number of the first cell to import in.
firstColumn
int
The column number of the first cell to import in.
ImportCSV(string, TxtLoadOptions, int, int)
Import a CSV file to the cells.
public void ImportCSV(string fileName, TxtLoadOptions options, int firstRow, int firstColumn)
Parameters
fileName
string
The CSV file name.
options
TxtLoadOptions
The load options for reading text file
firstRow
int
The row number of the first cell to import in.
firstColumn
int
The column number of the first cell to import in.
ImportCSV(Stream, TxtLoadOptions, int, int)
Import a CSV file to the cells.
public void ImportCSV(Stream stream, TxtLoadOptions options, int firstRow, int firstColumn)
Parameters
stream
Stream
The CSV file stream.
options
TxtLoadOptions
The load options for reading text file
firstRow
int
The row number of the first cell to import in.
firstColumn
int
The column number of the first cell to import in.
ImportCustomObjects(ICollection, string[], bool, int, int, int, bool, string, bool)
Imports custom objects.
public int ImportCustomObjects(ICollection list, string[] propertyNames, bool isPropertyNameShown, int firstRow, int firstColumn, int rowNumber, bool insertRows, string dateFormatString, bool convertStringToNumber)
Parameters
list
ICollection
The custom object
propertyNames
string[]
The property names.If it is null,we will import all properties of the object.
isPropertyNameShown
bool
Indicates whether the property name will be imported to the first row.
firstRow
int
The row number of the first cell to import in.
firstColumn
int
The column number of the first cell to import in.
rowNumber
int
Number of rows to be imported.
insertRows
bool
Indicates whether extra rows are added to fit data.
dateFormatString
string
Date format string for cells.
convertStringToNumber
bool
Indicates if this method will try to convert string to number.
Returns
Total number of rows imported.
Remarks
The custom objects should be the same type.
ImportCustomObjects(ICollection, int, int, ImportTableOptions)
Imports custom objects.
public int ImportCustomObjects(ICollection list, int firstRow, int firstColumn, ImportTableOptions options)
Parameters
list
ICollection
The custom object
firstRow
int
The row number of the first cell to import in.
firstColumn
int
The column number of the first cell to import in.
options
ImportTableOptions
The import options.
Returns
Total number of rows imported.
Remarks
The custom objects should be the same type.
ImportData(ICellsDataTable, int, int, ImportTableOptions)
Import data from custom data table.
public int ImportData(ICellsDataTable table, int firstRow, int firstColumn, ImportTableOptions options)
Parameters
table
ICellsDataTable
The custom data table.
firstRow
int
First row index.
firstColumn
int
First column index.
options
ImportTableOptions
The import options
Returns
ImportData(DataTable, int, int, ImportTableOptions)
Import data from custom data table.
public int ImportData(DataTable table, int firstRow, int firstColumn, ImportTableOptions options)
Parameters
table
DataTable
The System.Data.DataTable object to be imported.
firstRow
int
First row index.
firstColumn
int
First column index.
options
ImportTableOptions
The import options
Returns
Total number of rows imported.
Examples
[C#]
Workbook excel = new Workbook();
Cells cells = excel.Worksheets[0].Cells;
//Import data
DataTable dt = new DataTable("Products");
dt.Columns.Add("Product_ID",typeof(Int32));
dt.Columns.Add("Product_Name",typeof(string));
dt.Columns.Add("Units_In_Stock",typeof(Int32));
DataRow dr = dt.NewRow();
dr[0] = 1;
dr[1] = "Aniseed Syrup";
dr[2] = 15;
dt.Rows.Add(dr);
dr = dt.NewRow();
dr[0] = 2;
dr[1] = "Boston Crab Meat";
dr[2] = 123;
dt.Rows.Add(dr);
ImportTableOptions options = new ImportTableOptions();
options.IsFieldNameShown = true;
cells.ImportData(dt, 12, 12, options);
```
```vb
Dim excel as Workbook = new Workbook()
Dim cells as Cells = excel.Worksheets(0).Cells
'Import data
Dim dt as DataTable = new DataTable("Employee")
dt.Columns.Add("Employee_ID",typeof(Int32))
dt.Columns.Add("Employee_Name",typeof(string))
dt.Columns.Add("Gender",typeof(string))
Dim dr as DataRow = dt.NewRow()
dr(0) = 1
dr(1) = "John Smith"
dr(2) = "Male"
dt.Rows.Add(dr)
dr = dt.NewRow()
dr(0) = 2
dr(1) = "Mary Miller"
dr(2) = "Female"
dt.Rows.Add(dr)
Dim options as ImportTableOptions = new ImportTableOptions()
options.IsFieldNameShown = True
cells.ImportData(dt, 12, 12, options)
'Export data
Dim outDataTable as DataTable = cells.ExportDataTable(12, 12, 10, 10)
```
### ImportData\(DataView, int, int, ImportTableOptions\)
Import data from data view.
```csharp
public int ImportData(DataView dataView, int firstRow, int firstColumn, ImportTableOptions options)
```
#### Parameters
`dataView` [DataView](https://learn.microsoft.com/dotnet/api/system.data.dataview)
The System.Data.DataView object to be imported.
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
First row index.
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
First column index.
`options` [ImportTableOptions](/cells/aspose.cells.importtableoptions)
The import options
#### Returns
[int](https://learn.microsoft.com/dotnet/api/system.int32)
Total number of rows imported.
### ImportData\(IDataReader, int, int\)
Imports data from a System.Data.IDataReader object.
```csharp
public int ImportData(IDataReader reader, int firstRow, int firstColumn)
```
#### Parameters
`reader` [IDataReader](https://learn.microsoft.com/dotnet/api/system.data.idatareader)
The System.Data.IDataReader object which contains data.
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row number of the first cell to import in.
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The column number of the first cell to import in.
#### Returns
[int](https://learn.microsoft.com/dotnet/api/system.int32)
Total number of rows imported.
### ImportData\(IDataReader, int, int, ImportTableOptions\)
Imports data from a System.Data.IDataReader object.
```csharp
public int ImportData(IDataReader reader, int firstRow, int firstColumn, ImportTableOptions options)
```
#### Parameters
`reader` [IDataReader](https://learn.microsoft.com/dotnet/api/system.data.idatareader)
The System.Data.IDataReader object which contains data.
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row number of the first cell to import in.
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The column number of the first cell to import in.
`options` [ImportTableOptions](/cells/aspose.cells.importtableoptions)
The options of importing table.
#### Returns
[int](https://learn.microsoft.com/dotnet/api/system.int32)
Total number of rows imported.
### ImportDataRow\(DataRow, int, int\)
Imports a DataRow into the Excel file.
```csharp
public void ImportDataRow(DataRow dataRow, int row, int firstColumn)
```
#### Parameters
`dataRow` [DataRow](https://learn.microsoft.com/dotnet/api/system.data.datarow)
DataRow object.
`row` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Row index.
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
First column index.
### ImportDataView\(DataView, int, int\)
Imports a System.Data.DataView into a worksheet.
```csharp
public int ImportDataView(DataView dataView, int firstRow, int firstColumn)
```
#### Parameters
`dataView` [DataView](https://learn.microsoft.com/dotnet/api/system.data.dataview)
The System.Data.DataView object to be imported.
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row number of the first cell to import in.
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The column number of the first cell to import in.
#### Returns
[int](https://learn.microsoft.com/dotnet/api/system.int32)
Total number of rows imported
### ImportFormulaArray\(string\[\], int, int, bool\)
Imports an array of formula into a worksheet.
```csharp
public void ImportFormulaArray(string[] stringArray, int firstRow, int firstColumn, bool isVertical)
```
#### Parameters
`stringArray` [string](https://learn.microsoft.com/dotnet/api/system.string)\[\]
Formula array.
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row number of the first cell to import in.
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The column number of the first cell to import in.
`isVertical` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Specifies to import data vertically or horizontally.
### ImportObjectArray\(object\[\], int, int, bool\)
Imports an array of data into a worksheet.
```csharp
public void ImportObjectArray(object[] objArray, int firstRow, int firstColumn, bool isVertical)
```
#### Parameters
`objArray` [object](https://learn.microsoft.com/dotnet/api/system.object)\[\]
Data array.
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row number of the first cell to import in.
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The column number of the first cell to import in.
`isVertical` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Specifies to import data vertically or horizontally.
### ImportObjectArray\(object\[\], int, int, bool, int\)
Imports an array of data into a worksheet.
```csharp
public void ImportObjectArray(object[] objArray, int firstRow, int firstColumn, bool isVertical, int skip)
```
#### Parameters
`objArray` [object](https://learn.microsoft.com/dotnet/api/system.object)\[\]
Data array.
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row number of the first cell to import in.
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The column number of the first cell to import in.
`isVertical` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Specifies to import data vertically or horizontally.
`skip` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Skipped number of rows or columns.
### ImportTwoDimensionArray\(object\[,\], int, int\)
Imports a two-dimension array of data into a worksheet.
```csharp
public void ImportTwoDimensionArray(object[,] objArray, int firstRow, int firstColumn)
```
#### Parameters
`objArray` [object](https://learn.microsoft.com/dotnet/api/system.object)\[,\]
Two-dimension data array.
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row number of the first cell to import in.
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The column number of the first cell to import in.
### ImportTwoDimensionArray\(object\[,\], int, int, bool\)
Imports a two-dimension array of data into a worksheet.
```csharp
public void ImportTwoDimensionArray(object[,] objArray, int firstRow, int firstColumn, bool convertStringToNumber)
```
#### Parameters
`objArray` [object](https://learn.microsoft.com/dotnet/api/system.object)\[,\]
Two-dimension data array.
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row number of the first cell to import in.
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The column number of the first cell to import in.
`convertStringToNumber` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Indicates if this method will try to convert string to number.
### ImportTwoDimensionArray\(object\[,\], object\[,\], int, int, bool\)
Imports a two-dimension array of data into a worksheet.
```csharp
public void ImportTwoDimensionArray(object[,] objArray, object[,] styles, int firstRow, int firstColumn, bool convertStringToNumber)
```
#### Parameters
`objArray` [object](https://learn.microsoft.com/dotnet/api/system.object)\[,\]
Two-dimension data array.
`styles` [object](https://learn.microsoft.com/dotnet/api/system.object)\[,\]
Two-dimension data style.
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row number of the first cell to import in.
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The column number of the first cell to import in.
`convertStringToNumber` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Indicates if this method will try to convert string to number.
### ImportTwoDimensionArray\(object\[,\], object\[,\], int, int, TxtLoadOptions\)
Imports a two-dimension array of data into a worksheet.
```csharp
public void ImportTwoDimensionArray(object[,] objArray, object[,] styles, int firstRow, int firstColumn, TxtLoadOptions opts)
```
#### Parameters
`objArray` [object](https://learn.microsoft.com/dotnet/api/system.object)\[,\]
Two-dimension data array.
`styles` [object](https://learn.microsoft.com/dotnet/api/system.object)\[,\]
Two-dimension data style.
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row number of the first cell to import in.
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The column number of the first cell to import in.
`opts` [TxtLoadOptions](/cells/aspose.cells.txtloadoptions)
Options for converting string values
### InsertColumn\(int, bool\)
Inserts a new column into the worksheet.
```csharp
public void InsertColumn(int columnIndex, bool updateReference)
```
#### Parameters
`columnIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Column index.
`updateReference` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Indicates if references in other worksheets will be updated.
### InsertColumn\(int\)
Inserts a new column into the worksheet.
```csharp
public void InsertColumn(int columnIndex)
```
#### Parameters
`columnIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Column index.
### InsertColumns\(int, int\)
Inserts some columns into the worksheet.
```csharp
public void InsertColumns(int columnIndex, int totalColumns)
```
#### Parameters
`columnIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Column index.
`totalColumns` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The number of columns.
### InsertColumns\(int, int, bool\)
Inserts some columns into the worksheet.
```csharp
public void InsertColumns(int columnIndex, int totalColumns, bool updateReference)
```
#### Parameters
`columnIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Column index.
`totalColumns` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The number of columns.
`updateReference` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Indicates if references in other worksheets will be updated.
### InsertColumns\(int, int, InsertOptions\)
Inserts some columns into the worksheet.
```csharp
public void InsertColumns(int columnIndex, int totalColumns, InsertOptions options)
```
#### Parameters
`columnIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Column index.
`totalColumns` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The number of columns.
`options` [InsertOptions](/cells/aspose.cells.insertoptions)
The options for inserting operation.
### InsertCutCells\(Range, int, int, ShiftType\)
Insert cut range.
```csharp
public void InsertCutCells(Range cutRange, int row, int column, ShiftType shiftType)
```
#### Parameters
`cutRange` [Range](/cells/aspose.cells.range)
The cut range.
`row` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row.
`column` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The column.
`shiftType` [ShiftType](/cells/aspose.cells.shifttype)
The shift type .
### InsertRange\(CellArea, int, ShiftType, bool\)
Inserts a range of cells and shift cells according to the shift option.
```csharp
public void InsertRange(CellArea area, int shiftNumber, ShiftType shiftType, bool updateReference)
```
#### Parameters
`area` [CellArea](/cells/aspose.cells.cellarea)
Shift area.
`shiftNumber` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of rows or columns to be inserted.
`shiftType` [ShiftType](/cells/aspose.cells.shifttype)
Shift cells option.
`updateReference` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Indicates whether update references in other worksheets.
### InsertRange\(CellArea, ShiftType\)
Inserts a range of cells and shift cells according to the shift option.
```csharp
public void InsertRange(CellArea area, ShiftType shiftType)
```
#### Parameters
`area` [CellArea](/cells/aspose.cells.cellarea)
Shift area.
`shiftType` [ShiftType](/cells/aspose.cells.shifttype)
Shift cells option.
### InsertRange\(CellArea, int, ShiftType\)
Inserts a range of cells and shift cells according to the shift option.
```csharp
public void InsertRange(CellArea area, int shiftNumber, ShiftType shiftType)
```
#### Parameters
`area` [CellArea](/cells/aspose.cells.cellarea)
Shift area.
`shiftNumber` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of rows or columns to be inserted.
`shiftType` [ShiftType](/cells/aspose.cells.shifttype)
Shift cells option.
### InsertRow\(int\)
Inserts a new row into the worksheet.
```csharp
public void InsertRow(int rowIndex)
```
#### Parameters
`rowIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Row index.
### InsertRows\(int, int, bool\)
Inserts multiple rows into the worksheet.
```csharp
public void InsertRows(int rowIndex, int totalRows, bool updateReference)
```
#### Parameters
`rowIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Row index.
`totalRows` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of rows to be inserted.
`updateReference` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Indicates if references in other worksheets will be updated.
### InsertRows\(int, int, InsertOptions\)
Inserts multiple rows into the worksheet.
```csharp
public void InsertRows(int rowIndex, int totalRows, InsertOptions options)
```
#### Parameters
`rowIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Row index.
`totalRows` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of rows to be inserted.
`options` [InsertOptions](/cells/aspose.cells.insertoptions)
Options for inserting operation.
### InsertRows\(int, int\)
Inserts multiple rows into the worksheet.
```csharp
public void InsertRows(int rowIndex, int totalRows)
```
#### Parameters
`rowIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Row index.
`totalRows` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of rows to be inserted.
### IsBlankColumn\(int\)
Checks whether given column is blank(does not contain any data).
```csharp
public bool IsBlankColumn(int columnIndex)
```
#### Parameters
`columnIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
the column index
#### Returns
[bool](https://learn.microsoft.com/dotnet/api/system.boolean)
true if given column does not contain any data
### IsColumnHidden\(int\)
Checks whether a column at given index is hidden.
```csharp
public bool IsColumnHidden(int columnIndex)
```
#### Parameters
`columnIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
column index
#### Returns
[bool](https://learn.microsoft.com/dotnet/api/system.boolean)
true if the column is hidden.
### IsDeletingRangeEnabled\(int, int, int, int\)
Check whether the range could be deleted.
```csharp
public bool IsDeletingRangeEnabled(int startRow, int startColumn, int totalRows, int totalColumns)
```
#### Parameters
`startRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The start row index of the range.
`startColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The start column index of the range.
`totalRows` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The number of the rows in the range.
`totalColumns` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The number of the columns in the range.
#### Returns
[bool](https://learn.microsoft.com/dotnet/api/system.boolean)
### IsRowHidden\(int\)
Checks whether a row at given index is hidden.
```csharp
public bool IsRowHidden(int rowIndex)
```
#### Parameters
`rowIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
row index
#### Returns
[bool](https://learn.microsoft.com/dotnet/api/system.boolean)
true if the row is hidden
### LinkToXmlMap\(string, int, int, string\)
Link to a xml map.
```csharp
public void LinkToXmlMap(string mapName, int row, int column, string path)
```
#### Parameters
`mapName` [string](https://learn.microsoft.com/dotnet/api/system.string)
name of xml map
`row` [int](https://learn.microsoft.com/dotnet/api/system.int32)
row of the destination cell
`column` [int](https://learn.microsoft.com/dotnet/api/system.int32)
column of the destination cell
`path` [string](https://learn.microsoft.com/dotnet/api/system.string)
path of xml element in xml map
### Merge\(int, int, int, int\)
Merges a specified range of cells into a single cell.
```csharp
public void Merge(int firstRow, int firstColumn, int totalRows, int totalColumns)
```
#### Parameters
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
First row of this range(zero based)
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
First column of this range(zero based)
`totalRows` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of rows(one based)
`totalColumns` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of columns(one based)
#### Remarks
Reference the merged cell via the address of the upper-left cell in the range.
### Merge\(int, int, int, int, bool\)
Merges a specified range of cells into a single cell.
```csharp
public void Merge(int firstRow, int firstColumn, int totalRows, int totalColumns, bool mergeConflict)
```
#### Parameters
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
First row of this range(zero based)
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
First column of this range(zero based)
`totalRows` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of rows(one based)
`totalColumns` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of columns(one based)
`mergeConflict` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Merge 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\(int, int, int, int, bool, bool\)
Merges a specified range of cells into a single cell.
```csharp
public void Merge(int firstRow, int firstColumn, int totalRows, int totalColumns, bool checkConflict, bool mergeConflict)
```
#### Parameters
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
First row of this range(zero based)
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
First column of this range(zero based)
`totalRows` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of rows(one based)
`totalColumns` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of columns(one based)
`checkConflict` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Indicates whether check the merged cells intersects other merged cells
`mergeConflict` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Merge 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.
### MoveRange\(CellArea, int, int\)
Moves the range.
```csharp
public void MoveRange(CellArea sourceArea, int destRow, int destColumn)
```
#### Parameters
`sourceArea` [CellArea](/cells/aspose.cells.cellarea)
The range which should be moved.
`destRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The dest row.
`destColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The dest column.
### RemoveDuplicates\(\)
Removes duplicate rows in the sheet.
```csharp
public void RemoveDuplicates()
```
### RemoveDuplicates\(int, int, int, int\)
Removes duplicate values in the range.
```csharp
public void RemoveDuplicates(int startRow, int startColumn, int endRow, int endColumn)
```
#### Parameters
`startRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The start row.
`startColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The start column
`endRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The end row index.
`endColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The end column index.
### RemoveDuplicates\(int, int, int, int, bool, int\[\]\)
Removes duplicate data of the range.
```csharp
public void RemoveDuplicates(int startRow, int startColumn, int endRow, int endColumn, bool hasHeaders, int[] columnOffsets)
```
#### Parameters
`startRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The start row.
`startColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The start column
`endRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The end row index.
`endColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The end column index.
`hasHeaders` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Indicates whether the range contains headers.
`columnOffsets` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[\]
The column offsets.
### RemoveFormulas\(\)
Removes all formula and replaces with the value of the formula.
```csharp
public void RemoveFormulas()
```
### RetrieveSubtotalSetting\(CellArea\)
Retrieves subtotals setting of the range.
```csharp
public SubtotalSetting RetrieveSubtotalSetting(CellArea ca)
```
#### Parameters
`ca` [CellArea](/cells/aspose.cells.cellarea)
The range
#### Returns
[SubtotalSetting](/cells/aspose.cells.subtotalsetting)
### SetColumnWidth\(int, double\)
Sets the width of the specified column in normal view.
```csharp
public void SetColumnWidth(int column, double width)
```
#### Parameters
`column` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Column index.
`width` [double](https://learn.microsoft.com/dotnet/api/system.double)
Width of column.Column width must be between 0 and 255.
#### Remarks
To hide a column, sets column width to zero.
### SetColumnWidthInch\(int, double\)
Sets column width in unit of inches in normal view.
```csharp
public void SetColumnWidthInch(int column, double inches)
```
#### Parameters
`column` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Column index.
`inches` [double](https://learn.microsoft.com/dotnet/api/system.double)
Number of inches.
### SetColumnWidthPixel\(int, int\)
Sets column width in unit of pixels in normal view.
```csharp
public void SetColumnWidthPixel(int column, int pixels)
```
#### Parameters
`column` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Column index.
`pixels` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of pixels.
### SetRowHeight\(int, double\)
Sets the height of the specified row.
```csharp
public void SetRowHeight(int row, double height)
```
#### Parameters
`row` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Row index.
`height` [double](https://learn.microsoft.com/dotnet/api/system.double)
Height of row.In unit of point It should be between 0 and 409.5.
### SetRowHeightInch\(int, double\)
Sets row height in unit of inches.
```csharp
public void SetRowHeightInch(int row, double inches)
```
#### Parameters
`row` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Row index.
`inches` [double](https://learn.microsoft.com/dotnet/api/system.double)
Number of inches. It should be between 0 and 409.5/72.
### SetRowHeightPixel\(int, int\)
Sets row height in unit of pixels.
```csharp
public void SetRowHeightPixel(int row, int pixels)
```
#### Parameters
`row` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Row index.
`pixels` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of pixels.
### SetViewColumnWidthPixel\(int, int\)
Sets the width of the column in different view.
```csharp
public void SetViewColumnWidthPixel(int column, int pixels)
```
#### Parameters
`column` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The column index.
`pixels` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The width in unit of pixels.
#### Remarks
If the current view type is Aspose.Cells.ViewType.PageLayoutView, the column's width is same as printed width.
### ShowGroupDetail\(bool, int\)
Expands the grouped rows/columns.
```csharp
public void ShowGroupDetail(bool isVertical, int index)
```
#### Parameters
`isVertical` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
True, expands the grouped rows.
`index` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row/column index
### Subtotal\(CellArea, int, ConsolidationFunction, int\[\]\)
Creates subtotals for the range.
```csharp
public void Subtotal(CellArea ca, int groupBy, ConsolidationFunction function, int[] totalList)
```
#### Parameters
`ca` [CellArea](/cells/aspose.cells.cellarea)
The range
`groupBy` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The field to group by, as a zero-based integer offset
`function` [ConsolidationFunction](/cells/aspose.cells.consolidationfunction)
The subtotal function.
`totalList` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[\]
An array of zero-based field offsets, indicating the fields to which the subtotals are added.
### Subtotal\(CellArea, int, ConsolidationFunction, int\[\], bool, bool, bool\)
Creates subtotals for the range.
```csharp
public void Subtotal(CellArea ca, int groupBy, ConsolidationFunction function, int[] totalList, bool replace, bool pageBreaks, bool summaryBelowData)
```
#### Parameters
`ca` [CellArea](/cells/aspose.cells.cellarea)
The range
`groupBy` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The field to group by, as a zero-based integer offset
`function` [ConsolidationFunction](/cells/aspose.cells.consolidationfunction)
The subtotal function.
`totalList` [int](https://learn.microsoft.com/dotnet/api/system.int32)\[\]
An array of zero-based field offsets, indicating the fields to which the subtotals are added.
`replace` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Indicates whether replace the current subtotals
`pageBreaks` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Indicates whether add page break between groups
`summaryBelowData` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
Indicates whether add summary below data.
### TextToColumns\(int, int, int, TxtLoadOptions\)
Splits content in specified column into multiple columns..
```csharp
public int TextToColumns(int row, int column, int totalRows, TxtLoadOptions options)
```
#### Parameters
`row` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row index.
`column` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The column index.
`totalRows` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The number of rows.
`options` [TxtLoadOptions](/cells/aspose.cells.txtloadoptions)
The split options.
#### Returns
[int](https://learn.microsoft.com/dotnet/api/system.int32)
Total column count of the split values.
### UnMerge\(int, int, int, int\)
Unmerges a specified range of merged cells.
```csharp
public void UnMerge(int firstRow, int firstColumn, int totalRows, int totalColumns)
```
#### Parameters
`firstRow` [int](https://learn.microsoft.com/dotnet/api/system.int32)
First row of this range(zero based)
`firstColumn` [int](https://learn.microsoft.com/dotnet/api/system.int32)
First column of this range(zero based)
`totalRows` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of rows(one based)
`totalColumns` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Number of columns(one based)
### UngroupColumns\(int, int\)
Ungroups columns.
```csharp
public void UngroupColumns(int firstIndex, int lastIndex)
```
#### Parameters
`firstIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The first column index to be ungrouped.
`lastIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The last column index to be ungrouped.
### UngroupRows\(int, int, bool\)
Ungroups rows.
```csharp
public void UngroupRows(int firstIndex, int lastIndex, bool isAll)
```
#### Parameters
`firstIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The first row index to be ungrouped.
`lastIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The last row index to be ungrouped.
`isAll` [bool](https://learn.microsoft.com/dotnet/api/system.boolean)
True, removes all grouped info.Otherwise, remove the outer group info.
### UngroupRows\(int, int\)
Ungroups rows.
```csharp
public void UngroupRows(int firstIndex, int lastIndex)
```
#### Parameters
`firstIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The first row index to be ungrouped.
`lastIndex` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The last row index to be ungrouped.
#### Remarks
Only removes outer group info.
### UnhideColumn\(int, double\)
Unhides a column
```csharp
public void UnhideColumn(int column, double width)
```
#### Parameters
`column` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Column index.
`width` [double](https://learn.microsoft.com/dotnet/api/system.double)
Column width.
### UnhideColumns\(int, int, double\)
Unhide multiple columns.
```csharp
public void UnhideColumns(int column, int totalColumns, double width)
```
#### Parameters
`column` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Column index.
`totalColumns` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Column number
`width` [double](https://learn.microsoft.com/dotnet/api/system.double)
Column width.
#### Remarks
Only applies the column width to the hidden columns.
### UnhideRow\(int, double\)
Unhides a row.
```csharp
public void UnhideRow(int row, double height)
```
#### Parameters
`row` [int](https://learn.microsoft.com/dotnet/api/system.int32)
Row index.
`height` [double](https://learn.microsoft.com/dotnet/api/system.double)
Row height. The row's height will be changed only when the row is hidden and given height value is positive.
### UnhideRows\(int, int, double\)
Unhides the hidden rows.
```csharp
public void UnhideRows(int row, int totalRows, double height)
```
#### Parameters
`row` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row index.
`totalRows` [int](https://learn.microsoft.com/dotnet/api/system.int32)
The row number.
`height` [double](https://learn.microsoft.com/dotnet/api/system.double)
Row height. The row's height will be changed only when the row is hidden and given height value is positive.