Returns the number of sheets in a reference.
Name | Type | Description |
arg1 | ApiRange | Is a reference for which you want to know the number of sheets it contains. If omitted the number of sheets in the workbook containing the function is returned. |
builder.CreateFile("xlsx"); // Add more sheets Api.AddSheet("Sheet2") Api.AddSheet("Sheet3") // Get the number of sheets var oFunction = Api.GetWorksheetFunction(); var result = oFunction.SHEETS(); const oWorksheet = Api.GetActiveSheet(); oWorksheet.GetRange("C3").SetValue(result); builder.SaveFile("xlsx", "SHEETS.xlsx"); builder.CloseFile();