Get Started
Usage API
More information

GetActiveSheet

GetActiveSheet() → { ApiWorksheet }

Get the object that represents the active sheet.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiWorksheet

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", "GetActiveSheet.xlsx");
builder.CloseFile();

Resulting document