SHEETS

function SHEETS(arg1: ApiRange = null): number | string | boolean

Description

Returns the number of sheets in a reference.

Parameters

arg1ApiRangedefault: null

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.

Returns

number | string | boolean

Try It


// 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);

Get Help

  • If you have any questions about ONLYOFFICE Docs, try the FAQ section first.
  • You can request a feature or report a bug by posting an issue on GitHub.
  • You can also ask our developers on ONLYOFFICE forum (registration required).