Programmer's Reference >
ExcelApplication API >
Cell
The Cell Object
A Cell object represents a single cell in a worksheet. To return a Cell object use Worksheet.Cells . Specify the cell by 0-based row and column indexes or by Excel-style reference:
Examples:
[csharp]
// Get Cell by Excel-style reference
ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Create();
Worksheet ws = wb.Worksheets[0];
Cell cellA1 = ws.Cells[0,0];
// Get Cell by Excel-style reference
ExcelApplication xla = new ExcelApplication();
Workbook wb = xla.Create();
Worksheet ws = wb.Worksheets[0];
Cell cellA1 = ws.Cells["A1"];
[vbnet]
// Get Cell by Excel-style reference
Dim xla As New ExcelApplication()
Dim wb As Workbook = xla.Create()
Dim ws As Worksheet = wb.Worksheets(0)
Dim cellA1 As Cell = ws.Cells(0, 0)
// Get Cell by Excel-style reference
Dim xla As New ExcelApplication()
Dim wb As Workbook = xla.Create()
Dim ws As Worksheet = wb.Worksheets(0)
Dim cellA1 As Cell = ws.Cells("A1")
Cell Enumerations
Name | Description |
Cell.CellValueType | A CellValueType value specifies the data type of the cell's value.
|
Cell Properties
Property |
Type |
Access |
Description |
ColumnNumber |
int
|
read |
Returns the cell's 0-based column number
|
Comment |
Comment
|
read |
Returns a Comment object representing a note attached to the cell, separate from other cell content
|
Formula |
String
|
read write |
Sets or returns a cell formula
|
HasComment |
boolean
|
read |
Returns true if a Comment object is associated with the cell
|
Name |
String
|
read |
Returns the cell's Excel-style name (such as, "B5")
|
RowNumber |
int
|
read |
Returns the cell's 0-based row number
|
Style |
Style
|
read write |
Sets or returns a Style object that determines how the cell looks, including number format, font, orientation, etc
|
Value |
Object
|
read write |
Sets or returns a cell value
|
ValueType |
CellValueType
|
read |
Returns the data type of the cell's value: "Blank, "Boolean", "Date", "Error", "Numeric", or "Text"
|
Cell Methods
Copyright 2005 © SoftArtisans, Inc. All Rights Reserved.
|