Get Started
Documentation

SetValue

SetValue(sValue) → { bool }

Set the value for the current cell or a cell range.

Parameters:

Name Type Description
sValue string

The general value for the cell or cell range in string format.

Returns:

Type
bool

Example

Copy code
builder.CreateFile("xlsx");
oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("B1").SetValue("2");
oWorksheet.GetRange("B2").SetValue("2");
oWorksheet.GetRange("A3").SetValue("2x2=");
oWorksheet.GetRange("B3").SetValue("=B1*B2");
builder.SaveFile("xlsx", "SetValue.xlsx");
builder.CloseFile();

Resulting document