A collection of worksheets in a workbook.

See

Hierarchy

Hierarchy

  • Base
    • WorksheetCollection

Implements

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

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

    Returns number

Methods

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

    If the workbook originally had no worksheets, the newly added worksheet will become the selected worksheet of the workbook. This can be changed after more worksheets are added by setting the WindowOptions.selectedWorksheet 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 worksheet (worksheet names are case-insensitively compared).

    Returns

    The Worksheet created with the specified name.

    Parameters

    • name: string

      The name to give the new Worksheet.

    Returns Worksheet

  • Clears all worksheets 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 worksheet is in the collection.

    Returns

    True if the worksheet is found; False otherwise.

    Parameters

    • worksheet: Worksheet

      The worksheet to locate in the collection.

    Returns boolean

  • Parameters

    • other: any

    Returns boolean

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

    Returns

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

    Parameters

    • name: string

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

    Returns boolean

  • Returns number

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

    Returns

    The index of the specified worksheet in the collection.

    See

    Worksheet.index

    Parameters

    • worksheet: Worksheet

      The worksheet of which to get the index.

    Returns number

  • Gets the worksheet at the specified index. The worksheet 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 worksheet to get.

    Returns Worksheet

  • Gets the worksheet with the specified name.

    Worksheet names are compared case-insensitively.

    The worksheet with the specified name.

    Throws

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

    See

    Sheet.name

    Parameters

    • name: string

      The name of the worksheet to get.

    Returns Worksheet

  • Removes the worksheet 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 worksheet to remove from the collection.

    Returns void

  • Removes the specified worksheet 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 worksheet was successfully removed from the collection; False if the worksheet did not exist in the collection.

    Parameters

    • worksheet: Worksheet

      The worksheet 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