The collection of WorksheetTable instances on a Worksheet.

See

Worksheet.tables

Hierarchy

Hierarchy

  • Base
    • WorksheetTableCollection

Implements

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

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

    Returns number

Methods

  • Formats a region as a table and adds an associated WorksheetTable to the collection.

    When the table is created, the specified 'tableStyle' will be applied to the value.

    When the table is created, the column names will be taken from the cells in the header row if 'tableHasHeaders' is True. If it is False, the column names will be generated and the cells for the header row will be inserted into the worksheet.

    The column names are unique within the owning WorksheetTable. If, when the table is created, there are two or more columns with the same name, the second and subsequent duplicate column names will have a number appended to make them unique. If any cells in the header row have a non-string value, their value will be changed to a string (the current display text of the cell). If any cells in the header row have no value, they will be given a generated column name.

    If the region partially contains any merged cell regions, they will be removed from the worksheet and the table region will be expanded to include all cells from the merged region.

    See

    Throws

    InvalidOperationException The owning worksheet has been removed from its workbook.

    Throws

    ArgumentNullException 'region' is null or empty.

    Throws

    ArgumentException 'region' is not a valid region address in the workbook's cell reference mode.

    Throws

    ArgumentException The specified 'tableStyle' does not exist in the Workbook.customTableStyles or Workbook.standardTableStyles collections.

    Throws

    InvalidOperationException The region contains one or more cells from another WorksheetTable.

    Throws

    InvalidOperationException The region contains one or more cells which have a multi-cell ArrayFormula applied.

    Throws

    InvalidOperationException The region contains one or more cells which are part of a WorksheetDataTable.

    Returns

    The WorksheetTable created the represent the formatted table for the region.

    Parameters

    Returns WorksheetTable

  • Clears the collection and removes all tables from the worksheet.

    Returns void

  • Determines whether the specified WorksheetTable is in the collection.

    Returns

    True if the WorksheetTable is in the collection; False otherwise.

    Parameters

    Returns boolean

  • Parameters

    • other: any

    Returns boolean

  • Determines whether a WorksheetTable with the specified name is in the collection.

    Table names are compared case-insensitively.

    Returns

    True if a WorksheetTable with the specified name is in the collection; False otherwise.

    Parameters

    • name: string

      The name of the WorksheetTable to find.

    Returns boolean

  • Returns number

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

    Returns

    The 0-based index of the specified WorksheetTable in the collection or -1 if the item is not in the collection.

    Parameters

    Returns number

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

    Returns WorksheetTable

  • Gets the WorksheetTable with the specified name.

    Worksheet names are compared case-insensitively.

    The WorksheetTable with the specified name.

    Throws

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

    See

    NamedReferenceBase.name

    Parameters

    • name: string

      The name of the WorksheetTable to get.

    Returns WorksheetTable

  • Removes the WorksheetTable at the specified index.

    Throws

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

    Parameters

    • index: number

      The 0-based index of the WorksheetTable to remove.

    • Optional convertToRange: boolean

      True to apply the table style formatting to the cells

    Returns void

  • Removes the WorksheetTable from the collection.

    Returns

    True if the WorksheetTable was found and removed; False otherwise.

    Parameters

    • table: WorksheetTable

      The WorksheetTable to remove from the collection.

    • Optional convertToRange: boolean

      True to apply the table style formatting to the cells

    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