Get Started
Usage API
More information

GetRows

GetRows(nRow) → { ApiRange }

Return a Range object that represents the rows in the specified range. If the specified row is outside the Range object, a new Range will be returned that represents the cells between the columns of the original range in the specified row.

Parameters:

Name Type Description
nRow number

The row number (starts counting from 1, the 0 value returns an error).

Returns:

Type
ApiRange

Example

Copy code
builder.CreateFile("xlsx");
oWorksheet = Api.GetActiveSheet();
oRange = oWorksheet.GetRange("A1:C3");
for (let i=1; i <= 3; i++) {
    oRows = oRange.GetRows(i);    
    oRows.SetValue(i);
}
builder.SaveFile("xlsx", "GetRows.xlsx");
builder.CloseFile();

Resulting document