A collection of columns in a worksheet.

Columns in this collection are lazily created (they are only created and added to the collection when they are accessed). Therefore, if this collection is enumerated, it only enumerates the columns which were already accessed.

See

  • [[WorksheetColumn]]
  • [[Worksheet.columns]]

Hierarchy

Hierarchy (view full)

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

  • get maxCount(): number
  • Gets the maximum number of items allowed in this collection.

    Returns number

Methods

  • Parameters

    • other: any

    Returns boolean

  • Inserts one or more columns into the collection Note: An equal number of columns will be removed (i.e. bumped) off the end of the collection.

    Throws

    [[InvalidOperationException]] If the operation is not allowed, e.g. if it would cause data to be shifted off the worksheet.

    Throws

    [[IndexOutOfRangeException]] If index is negative.

    Throws

    [[ArgumentOutOfRangeException]] If count is less than 1.

    Parameters

    • index: number

      the insertion point

    • Optional count: number

      The number of columns to insert

    Returns void

  • Gets the column at the specified index.

    Note: Iterating the collection will not create all columns. It will only iterate the columns which have already been used. To create and iterate all columns in the worksheet use a For loop, iterating from 0 to one less than the maximum column count, and pass in each index to the collection's indexer.

    The column at the specified index.

    Throws

    [[ArgumentOutOfRangeException]] 'index' is less than zero.

    Throws

    [[InvalidOperationException]] 'index' is greater than or equal to [[Workbook.maxExcelColumnCount]] or [[Workbook.maxExcel2007ColumnCount]], depending on the [[Workbook.currentFormat]].

    Parameters

    • a: number

    Returns WorksheetColumn

  • Removes one or more columns from the collection

    Throws

    [[InvalidOperationException]] If the operation is not allowed, e.g. if it the range intersects with a protected region.

    Throws

    [[IndexOutOfRangeException]] If index is negative.

    Throws

    [[ArgumentOutOfRangeException]] If count is less than 1.

    Parameters

    • index: number

      the index of the first column to remove point

    • Optional count: number

      The number of columns to remove

    Returns void

  • 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

  • Returns void