ExcelFile.SetCellValue Method
Overloads
- ExcelFile.SetCellValue(String, Object)
- ExcelFile.SetCellValue(Int32, Int32, Object)
- ExcelFile.SetCellValue(Int32, Int32, Object, Int32)
- ExcelFile.SetCellValue(Int32, Int32, Int32, Object, Int32)
ExcelFile.SetCellValue(String, Object)
Sets a cell value given a cell reference. While this is normally not needed because you can use TCellAddress to convert the cell reference to row and column and then use a standard SetCellValue call, it can be handy if you know the cell reference (like AX42) and want a fast way to set the value of the cell.
Syntax
Namespace: FlexCel.Core
public void SetCellValue(String cellRef, Object value)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
cellRef | String | Cell reference in A1 notation. Something like A3, or Sheet1!$B$5 can be used here. | |
value | Object | Value to set. |
See also
ExcelFile.SetCellValue(Int32, Int32, Object)
Sets the value on a cell.
Remarks
This method will enter the datatype of the object you pass to it. For example, if you set value="1" the string "1" will be entered on the cell. To convert a string to the best representation (on this case a number), use SetCellFromString(Int32, Int32, TRichString, Int32). To enter a HTML formatted string, use SetCellFromHtml(Int32, Int32, String, Int32)
Syntax
Namespace: FlexCel.Core
public void SetCellValue(Int32 row, Int32 col, Object value)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
row | Int32 | Row, 1 based. | |
col | Int32 | Column, 1 based. | |
value | Object | Value to set. |
See also
ExcelFile.SetCellValue(Int32, Int32, Object, Int32)
Sets the value and format on a cell.
Remarks
This method will enter the datatype of the object you pass to it. For example, if you set value="1" the string "1" will be entered on the cell. To convert a string to the best representation (on this case a number), use SetCellFromString(Int32, Int32, TRichString, Int32) To enter a HTML formatted string, use SetCellFromHtml(Int32, Int32, String, Int32)
Syntax
Namespace: FlexCel.Core
public abstract void SetCellValue(Int32 row, Int32 col, Object value, Int32 XF)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
row | Int32 | Row, 1 based. | |
col | Int32 | Column, 1 based. | |
value | Object | Value to set. | |
XF | Int32 | Format to Set. You normally get this number with AddFormat function. Use -1 to keep format unchanged. |
See also
ExcelFile.SetCellValue(Int32, Int32, Int32, Object, Int32)
Sets the value on a cell.
Remarks
This method will enter the datatype of the object you pass to it. For example, if you set value="1" the string "1" will be entered on the cell. To convert a string to the best representation (on this case a number), use SetCellFromString(Int32, Int32, TRichString, Int32). To enter a HTML formatted string, use SetCellFromHtml(Int32, Int32, String, Int32)
Syntax
Namespace: FlexCel.Core
public abstract void SetCellValue(Int32 sheet, Int32 row, Int32 col, Object value, Int32 XF)
Parameters
<-> | Parameter | Type | Description |
---|---|---|---|
sheet | Int32 | Sheet number, 1 based | |
row | Int32 | Row, 1 based. | |
col | Int32 | Column, 1 based. | |
value | Object | Value to set. | |
XF | Int32 | Format to Set. You normally get this number with AddFormat function. Use -1 to keep format unchanged. |