TRY NEW VERSION

Try now New API BETA

Try out the new view and capabilities of the API documentation

START

GetWorksheet

GetWorksheet() → { ApiWorksheet }

Returns the Worksheet object that represents the worksheet containing the specified range. It will be available in the read-only mode.

Parameters:

This method doesn't have any parameters.

Returns:

Type
ApiWorksheet

Example

Copy code
builder.CreateFile("xlsx");
var oWorksheet = Api.GetActiveSheet();
var oRange = oWorksheet.GetRange("A1:C1");
oRange.SetValue("1");
var oSheet = oRange.GetWorksheet();
oWorksheet.GetRange("A3").SetValue("Worksheet name: " + oSheet.GetName());
builder.SaveFile("xlsx", "GetWorksheet.xlsx");
builder.CloseFile();

Resulting document