A collection of sheets in a workbook.

See

Hierarchy

Hierarchy

  • Base
    • SheetCollection

Implements

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

  • get count(): number
  • Gets the number of sheets in the collection. The number of sheets in the collection.

    Returns number

Methods

  • Creates a new Sheet and adds it to the collection.

    If the workbook originally had no sheets, the newly added sheet will become the selected sheet of the workbook. This can be changed after more sheets are added by setting the WindowOptions.selectedSheet of the Workbook.

    Throws

    ArgumentNullException 'name' is null or empty.

    Throws

    ArgumentException 'name' contains the invalid characters: ':', '', '/', '?', '*', '[', or ']'.

    Throws

    ArgumentException 'name' exceeds 31 characters in length.

    Throws

    ArgumentException 'name' is being used as the name of another sheet (sheet names are case-insensitively compared).

    Returns

    The Sheet created with the specified name.

    Parameters

    • name: string

      The name to give the new Sheet.

    • type: SheetType

      An enumeration indicating the type of sheet to create

    Returns Sheet

  • Clears all sheets from the collection.

    If there are any NamedReference instances in the Workbook.namedReferences collection with a worksheet for a scope, they will be removed from the Workbook.

    Returns void

  • Determines whether a sheet is in the collection.

    Returns

    True if the sheet is found; False otherwise.

    Parameters

    • sheet: Sheet

      The sheet to locate in the collection.

    Returns boolean

  • Parameters

    • other: any

    Returns boolean

  • Determines whether a sheet with the specified name exists in the collection.

    Returns

    True if a sheet with the specified name is found; False otherwise.

    Parameters

    • name: string

      The name of the sheet to search for. The name is compared case-insensitively.

    Returns boolean

  • Returns number

  • Gets the index of the specified sheet in the collection.

    Returns

    The index of the specified sheet in the collection.

    See

    Sheet.sheetIndex

    Parameters

    • sheet: Sheet

      The sheet of which to get the index.

    Returns number

  • Gets the sheet at the specified index. The sheet at the specified index.

    Throws

    ArgumentOutOfRangeException 'index' is less than zero or 'index' is greater than or equal to count.

    Parameters

    • index: number

      The zero-based index of the sheet to get.

    Returns Sheet

  • Gets the sheet with the specified name.

    Sheet names are compared case-insensitively.

    The sheet with the specified name.

    Throws

    InvalidOperationException A sheet with the specified name does not exist in the collection.

    See

    Sheet.name

    Parameters

    • name: string

      The name of the sheet to get.

    Returns Sheet

  • Removes the sheet at the specified index from the collection.

    If there are any NamedReference instances in the Workbook.namedReferences collection with the worksheet to remove as their scope, they will be removed from the Workbook.

    Throws

    ArgumentOutOfRangeException 'index' is less than zero or 'index' is greater than or equal to count.

    Parameters

    • index: number

      The index of the sheet to remove from the collection.

    Returns void

  • Removes the specified sheet from the collection.

    If there are any NamedReference instances in the Workbook.namedReferences collection with the worksheet to remove as their scope, they will be removed from the Workbook.

    Returns

    True if the sheet was successfully removed from the collection; False if the sheet did not exist in the collection.

    Parameters

    • sheet: Sheet

      The sheet to remove from the collection.

    Returns boolean

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns number

  • Parameters

    • item1: any
    • item2: any

    Returns boolean

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns number

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Returns void