Get Started
Usage API
More information

SetOffset

SetOffset(nRow, nCol)

Set cell offset

Parameters:

Name Type Description
nRow number

The row number.

nCol number

The column number.

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("xlsx");
oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("B3").SetValue("Old Range");
oRange = oWorksheet.GetRange("B3");
oRange.SetOffset(2, 2);
oRange.SetValue("New Range");
builder.SaveFile("xlsx", "SetOffset.xlsx");
builder.CloseFile();

Resulting document