Get Started
Usage API

GetSheets

GetSheets() → { Array.<ApiWorksheet> }

Returns a Sheets collection that represents all the sheets in the active workbook.

Parameters:

This method doesn't have any parameters.

Returns:

Type
Array.<ApiWorksheet>

Example

Copy code
builder.CreateFile("xlsx");
Api.AddSheet("new_sheet_name");
sheets = Api.GetSheets();
sheet_name1 = sheets[0].GetName();
sheet_name2 = sheets[1].GetName();
sheets[1].GetRange("A1").SetValue(sheet_name1);
sheets[1].GetRange("A2").SetValue(sheet_name2);
builder.SaveFile("xlsx", "GetSheets.xlsx");
builder.CloseFile();

Resulting document