Get Started
Documentation

SetActive

SetActive()

Makes the current sheet the active sheet.

Parameters:

This method doesn't have any parameters.

Returns:

This method doesn't return any data.

Example

Copy code
builder.CreateFile("xlsx");
Api.AddSheet("New_sheet");
oSheet = Api.GetSheet("New_sheet");
oSheet.SetActive();
oWorksheet = Api.GetActiveSheet();
oWorksheet.GetRange("A1").SetValue("The current sheet is active.");
builder.SaveFile("xlsx", "SetActive.xlsx");
builder.CloseFile();

Resulting document