ExcelCell Class
Excel cell provides access to a single worksheet cell or to a merged range if the cell is merged.
- Inheritance:
- System.
Object ExcelCell
Remarks
Merged range is created by using Merged property. See the property documentation for more information on merging.
Properties
BoolValue
Gets the boolean value of this cell or of merged range if this cell is merged.
Property Value
- System.
Boolean
The boolean value.
Column
Gets column of the cell.
Property Value
Comment
Gets or sets cell comment.
Property Value
Overrides
DateTimeValue
Gets the DateTime value of this cell or of merged range if this cell is merged.
Property Value
- System.
Date Time
The DateTime value.
DoubleValue
Gets the double value of this cell or of merged range if this cell is merged.
Property Value
- System.
Double
The double value.
Formula
Gets or sets cell formula string.
Property Value
- System.
String
Overrides
Remarks
In XLSX files, reading and writing of all formulas are supported.
In XLS files, reading and writing of all common and most of the advanced formulas are supported.
In XLSB files, reading and writing of all common and most of the advanced formulas are supported.
In ODS files, reading and writing of all formulas are supported, however, OpenOffice formulas don't have the same syntax as Excel formulas.
In CSV files, reading of all formulas is supported.
When adding formulas in new versions of Excel, it often automatically interprets formulas as dynamic array formulas. You can consider using the Set
For more information on formulas, consult Microsoft Excel documentation.
FormulaR1C1
Gets or sets a formula string in R1C1 notation.
Property Value
- System.
String
Overrides
FormulaRange
Gets the range of cells that are affected by the formula stored in this cell.
Property Value
Remarks
This property is only relevant for array formulas and dynamic array formulas.
When the formula of this cell was set using the Set
FormulaType
Gets the type of formula stored in this cell.
Property Value
Hyperlink
Gets or sets cell hyperlink.
Property Value
Overrides
IntValue
Gets the integer value of this cell or of merged range if this cell is merged.
Property Value
- System.
Int32
The integer value.
MergedRange
Returns associated merged range if the cell is merged; otherwise, null.
Property Value
See Also
Row
Gets row of the cell.
Property Value
StringValue
Gets the string value of this cell or of merged range if this cell is merged.
Property Value
- System.
String
The string value.
Value
Gets or sets value of this cell or of merged range if this cell is merged.
Property Value
- System.
Object
Overrides
Remarks
Exception is thrown if value for the set is not of supported type (See Supports
Note that the fact some type is supported doesn't mean it is written to Excel file in the native format. As Microsoft Excel has just few basic types, the object of supported type will be converted to a similar excel type. If similar excel type doesn't exist, value is written as a string value.
If the value of this property is of System.
Exceptions
- System.
Not Supported Exception
Value is not supported.
See Also
ValueType
Gets the cell value type.
Property Value
Worksheet
Gets the parent worksheet.
Property Value
Methods
Calculate()
Calculates formula for this excel cell.
Overrides
ConvertDateTimeToExcelNumber(DateTime, Boolean)
Converts System.
Parameters
date
- System.
Date Time
DateTime structure.
use1904DateSystem
- System.
Boolean
True to use 1904 date system.
Returns
- System.
Double
Converted Excel floating-point number.
ConvertExcelNumberToDateTime(Double, Boolean)
Converts Excel floating-point number to System.
Parameters
num
- System.
Double
Excel floating-point number.
use1904DateSystem
- System.
Boolean
True to use 1904 date system.
Returns
- System.
Date Time
Converted DateTime structure.
Remarks
Excel file format doesn't have a separate data type for date and time. System.
However, if some non-standard date/time number format is used, cell value will not be recognized as System.
Equals(Object)
Determines whether the specified System.
Parameters
obj
- System.
Object
The System.
Returns
- System.
Boolean
Overrides
GetCurrentRegion()
Selects a worksheet region to which the cell belongs to.
Returns
The worksheet region to which the cell belongs to.
GetFormattedValue()
Converts Value of this Excel
Returns
- System.
String
Formatted Value
GetHashCode()
Returns a hash code for this Excel
Returns
- System.
Int32
An integer value that specifies a hash value for this Excel
Overrides
Insert(InsertShiftDirection)
Inserts a cell by shifting cells in the specified direction.
Parameters
direction
- Insert
Shift Direction
The shift direction.
Overrides
Remove(RemoveShiftDirection)
Removes a cell by shifting cells in the specified direction.
Parameters
direction
- Remove
Shift Direction
The shift direction.
Overrides
SetArrayFormula(String, Int32, Int32)
Sets the array formula (also known as CSE formula) to the range of cells.
Parameters
formula
- System.
String
The array formula.
rowCount
- System.
Int32
The number of rows that should be populated with the result of the array formula.
columnCount
- System.
Int32
The number of columns that should be populated with the result of the array formula.
See Also
SetDynamicArrayFormula(String)
Sets the dynamic array formula. Dynamic array formulas spill the result of the formula to neighbouring cells and are recommended as a replacement for array formulas in newer versions of MS Excel.
Parameters
formula
- System.
String
The dynamic array formula.
Remarks
Dynamic array formulas are fully supported only in Excel 365, Excel 2021, and newer versions. Dynamic array formulas opened in Excel 2019 or older will be shown as legacy array formulas (also known as CSE formulas).
See Also
SetValue(Boolean)
Sets the boolean value to this cell or to merged range if this cell is merged.
Parameters
value
- System.
Boolean
The boolean value.
SetValue(DateTime)
Sets the DateTime value to this cell or to merged range if this cell is merged.
Parameters
value
- System.
Date Time
The DateTime value.
SetValue(Double)
Sets the double value to this cell or to merged range if this cell is merged.
Parameters
value
- System.
Double
The double value.
SetValue(Int32)
Sets the integer value to this cell or to merged range if this cell is merged.
Parameters
value
- System.
Int32
The integer value.
SetValue(String)
Sets the string value to this cell or to merged range if this cell is merged.
Parameters
value
- System.
String
The string value.
SetValue(String, HtmlLoadOptions)
Loads the specified HTML text as the value of this Excel
Parameters
html
- System.
String
The HTML text which should be loaded as the value of this Excel
options
- Html
Load Options
The options used to define settings for load operation.
Operators
Equality(ExcelCell, ExcelCell)
Determines whether first
and second
Excel
Parameters
Returns
- System.
Boolean
true if first
and second
Excel
Inequality(ExcelCell, ExcelCell)
Determines whether first
and second
Excel
Parameters
Returns
- System.
Boolean
true if first
and second
Excel
Inherited Properties
Character | Returns all Formatted (Inherited from Abstract |
Name | Gets the name of Abstract (Inherited from Abstract |
Style | Gets or sets the cell formatting of one or more cells. (Inherited from Abstract |
Inherited Methods
Clear(Clear | Clears the range (content, formatting, comment, hyperlink or all). (Inherited from Abstract |
Get | Returns a Formatted (Inherited from Abstract |
Get | Returns a Formatted (Inherited from Abstract |
Replace | Replaces all matches of the specified System. (Inherited from Abstract |
Replace | Replaces all occurrences of the specified text with another text in the current Abstract (Inherited from Abstract |
Replace | Replaces all occurrences of the specified text with another text in the current Abstract (Inherited from Abstract |
Replace | Replaces all occurrences of the specified text with another text in the current Abstract (Inherited from Abstract |
To | Returns a System. (Inherited from Abstract |