A collection of [[WorksheetShape]] instances in a [[Worksheet]] or [[WorksheetShapeGroup]]. @see@see

Hierarchy

Hierarchy

  • Base
    • WorksheetShapeCollection

Implements

Constructors

Properties

$type: Type
$t: Type
nextHashCode: number

Accessors

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

    Returns number

Methods

  • Returns EnumeratorWrapper<WorksheetShape>

  • Adds a predefined shape to the collection with the specified bounds.

    Throws

    [[ArgumentNullException]] 'sheet' is null.

    Throws

    [[InvalidEnumArgumentException]] 'shapeType' is not defined in the [[PredefinedShapeType]] enumeration.

    Parameters

    • shapeType: PredefinedShapeType

      The type of shape to add to the collection.

    • sheet: Sheet

      The [[sheet]] to which the 'boundsInTwips' relate.

    • boundsInTwips: IgRect

      The bounds of the shape on the 'sheet' in twips (1/20th of a point).

    Returns WorksheetShape

  • Adds a predefined shape to the collection with the specified anchors.

    Throws

    [[InvalidEnumArgumentException]] 'shapeType' is not defined in the [[PredefinedShapeType]] enumeration.

    Throws

    [[InvalidOperationException]] 'topLeftCornerCell' or 'bottomRightCornerCell' is null.

    Throws

    [[InvalidOperationException]] 'topLeftCornerCell' and 'bottomRightCornerCell' belong to different worksheets or a worksheet other than the worksheet to which this collection belongs.

    Parameters

    • shapeType: PredefinedShapeType

      The type of shape to add to the collection.

    • topLeftCornerCell: WorksheetCell

      The cell where the top-left corner of the shape resides.

    • topLeftCornerPosition: IgPoint

      The position in the 'topLeftCornerCell' of the shape's top-left corner, expressed in percentages.

    • bottomRightCornerCell: WorksheetCell

      The cell where the bottom-right corner of the shape resides.

    • bottomRightCornerPosition: IgPoint

      the position in the 'bottomRightCornerCell' of the shape's bottom-right corner, expressed in percentages.

    Returns WorksheetShape

  • Adds a predefined shape to the collection with the specified bounds.

    Throws

    [[InvalidOperationException]] This shapes collection belongs to a [[WorksheetShapeGroup]] which isn't placed on a Worksheet yet. In this case, call [[add]] instead and specify the Worksheet where the group will be added.

    Throws

    [[InvalidEnumArgumentException]] 'shapeType' is not defined in the [[PredefinedShapeType]] enumeration.

    Parameters

    • shapeType: PredefinedShapeType

      The type of shape to add to the collection.

    • boundsInTwips: IgRect

      The bounds of the shape on the [[Worksheet]] in twips (1/20th of a point).

    Returns WorksheetShape

  • Adds a shape to the collection.

    Throws

    [[ArgumentNullException]] 'shape' is null.

    Throws

    [[InvalidOperationException]] 'shape' has already been added to a worksheet or group.

    Throws

    [[InvalidOperationException]] 'shape' does not have the [[WorksheetShape.topLeftCornerCell]] or [[WorksheetShape.bottomRightCornerCell]] set.

    Throws

    [[InvalidOperationException]] Adding 'shape' to this collection will place it on a different worksheet then either its TopLeftCornerCell or BottomRightCornerCell or 'shape' is a [[WorksheetShapeGroup]] and adding it to this collection will create a similar situation for one of its descendant shapes.

    Throws

    [[InvalidOperationException]] 'shape' is a WorksheetShapeGroup and this is the group's collection of shapes.

    Parameters

    Returns void

  • Adds a chart to the collection with the specified bounds.

    Throws

    [[ArgumentNullException]] if sheet is null.

    Throws

    [[InvalidEnumArgumentException]] 'chartType' is not defined in the [[ChartType]] enumeration.

    Throws

    [[InvalidOperationException]] if a chart is being added to the Shapes collection of another Chart is null.

    Throws

    [[InvalidOperationException]] if a Workbook.CurrentFormat doesn't support Chart mofications, e.g. 'Excel97To2003' or 'Excel97To2003Template'.

    Parameters

    • chartType: ChartType

      The type of chart to add to the collection.

    • sheet: Sheet

      The [[sheet]] to which the 'boundsInTwips' relate.

    • boundsInTwips: IgRect

      The bounds of the shape on the 'sheet' in twips (1/20th of a point).

    • Optional chartInitializer: ((arg1) => void)

      An optional callback for initializing the chart before it is added to the collection.

    Returns WorksheetChart

  • Adds a chart to the collection with the specified bounds.

    Throws

    [[InvalidEnumArgumentException]] 'chartType' is not defined in the [[ChartType]] enumeration.

    Throws

    [[InvalidOperationException]] 'topLeftCornerCell' or 'bottomRightCornerCell' is null.

    Throws

    [[InvalidOperationException]] 'topLeftCornerCell' and 'bottomRightCornerCell' belong to different worksheets or a worksheet other than the worksheet to which this collection belongs.

    Throws

    [[InvalidOperationException]] if a chart is being added to the Shapes collection of another Chart is null.

    Throws

    [[InvalidOperationException]] if a Workbook.CurrentFormat doesn't support Chart mofications, e.g. 'Excel97To2003' or 'Excel97To2003Template'.

    Parameters

    • chartType: ChartType

      The type of chart to add to the collection.

    • topLeftCornerCell: WorksheetCell

      The cell where the top-left corner of the shape resides.

    • topLeftCornerPosition: IgPoint

      The position in the 'topLeftCornerCell' of the shape's top-left corner, expressed in percentages.

    • bottomRightCornerCell: WorksheetCell

      The cell where the bottom-right corner of the shape resides.

    • bottomRightCornerPosition: IgPoint

      the position in the 'bottomRightCornerCell' of the shape's bottom-right corner, expressed in percentages.

    • Optional chartInitializer: ((arg1) => void)

      An optional callback for initializing the chart before it is added to the collection.

    Returns WorksheetChart

  • Adds a chart to the collection with the specified bounds.

    Throws

    [[ArgumentNullException]] if worksheet is null.

    Throws

    [[InvalidEnumArgumentException]] 'chartType' is not defined in the [[ChartType]] enumeration.

    Throws

    [[InvalidOperationException]] if a chart is being added to the Shapes collection of another Chart is null.

    Throws

    [[InvalidOperationException]] if a Workbook.CurrentFormat doesn't support Chart mofications, e.g. 'Excel97To2003' or 'Excel97To2003Template'.

    Parameters

    • chartType: ChartType

      The type of chart to add to the collection.

    • boundsInTwips: IgRect

      The bounds of the shape on the worksheet in twips (1/20th of a point).

    • Optional chartInitializer: ((arg1) => void)

      An optional callback for initializing the chart before it is added to the collection.

    Returns WorksheetChart

  • Clears all shapes from the collection.

    Returns void

  • Determines whether a shape is in the collection.

    Parameters

    Returns boolean

  • Parameters

    • other: any

    Returns boolean

  • Returns number

  • Gets the shape at the specified index in the collection. The shape at the specified index.

    Throws

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

    Parameters

    • a: number

    Returns WorksheetShape

  • Returns Base

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

    Throws

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

    Parameters

    • index: number

      The index of the shape to remove from the collection.

    Returns void

  • Removes the specified shape from the collection.

    Parameters

    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