Get Started
Usage API
More information

GetRange

GetRange(sRange) → { ApiRange }

Return an ApiRange.

Parameters:

Name Type Description
sRange string

The range of cells from the current sheet.

Returns:

Type
ApiRange

Example

Copy code
builder.CreateFile("xlsx");
oWorksheet = Api.GetActiveSheet();
oRange = Api.GetRange("A1:C1");
oRange.SetFillColor(Api.CreateColorFromRGB(255, 224, 204));
oWorksheet.GetRange("A3").SetValue("The color was set to the background of cells A1:C1.");
builder.SaveFile("xlsx", "GetRange.xlsx");
builder.CloseFile();

Resulting document