A collection of workbook styles, or complex formats which can be easily applied to cells in Microsoft Excel.

See

WorkbookStyle

Hierarchy

Hierarchy

  • Base
    • WorkbookStyleCollection

Implements

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

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

    Returns number

  • get normalStyle(): WorkbookStyle
  • Gets the default style for the workbook.

    The normal style is the parent style for all cell and differential formats in the workbook, unless another parent style is specified.

    See

    IWorksheetCellFormat.style

    Returns WorkbookStyle

Methods

  • Returns IEnumerable$1<WorkbookBuiltInStyle>

  • Adds new user defined style to the workbook.

    Throws

    ArgumentNullException 'name' is null or empty.

    Throws

    ArgumentNullException 'name' is longer than 255 characters.

    Throws

    ArgumentException A style already exists with the a name of 'name'. Names are compared case-insensitively.

    Returns

    The added user defined style as a WorkbookStyle instance.

    Parameters

    • styleFormat: IWorksheetCellFormat

      A cell format of the style.

    • name: string

      The name which will identify the style in Microsoft Excel.

    Returns WorkbookStyle

  • Adds new user defined style to the workbook.

    Throws

    ArgumentNullException 'name' is null or empty.

    Throws

    ArgumentNullException 'name' is longer than 255 characters.

    Throws

    ArgumentException A style already exists with the a name of 'name'. Names are compared case-insensitively.

    Returns

    The added user defined style as a WorkbookStyle instance.

    Parameters

    • name: string

      The name which will identify the style in Microsoft Excel.

    Returns WorkbookStyle

  • Clears all styles, other than the Normal style, from the collection.

    See

    normalStyle

    Returns void

  • Determines whether a style is in the collection.

    Returns

    True if the style is found; False otherwise.

    Parameters

    Returns boolean

  • Parameters

    • other: any

    Returns boolean

  • Returns number

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

    Returns WorkbookStyle

  • Gets the style with the specified name.

    Style names are compared case-insensitively.

    The style with the specified name or null if no style with that name exists.

    Throws

    ArgumentNullException 'name' is null.

    Parameters

    • name: string

      The name of the style to get.

    Returns WorkbookStyle

  • Removes the specified style from the collection.

    Throws

    InvalidOperationException 'style' is the Normal style.

    Returns

    True if the style was successfully removed; False if the style was not in the collection.

    See

    normalStyle

    Parameters

    Returns boolean

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

    Throws

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

    Throws

    InvalidOperationException The style to remove at 'index' is the Normal style.

    See

    normalStyle

    Parameters

    • index: number

      The zero-based index of the style in the collection.

    Returns void

  • Resets the collection to its original state by clearing all styles and adding in preset built in styles.

    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

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns any[]

  • Parameters

    • obj: any

    Returns number

  • Parameters

    • a: any
    • b: any

    Returns boolean

  • Returns void