ShapeCollection

ShapeCollection class

Represents all the shape in a worksheet/chart.

class ShapeCollection;

Methods

MethodDescription
get(number)Gets the Shape object at the specific index in the list.
get(string)Gets the Shape object by the name of the shape.
addCopy(Shape, number, number, number, number)Adds and copy a shape to the worksheet.
addCheckBox(number, number, number, number, number, number)Adds a checkbox to the worksheet.
addTextBox(number, number, number, number, number, number)Adds a text box to the worksheet.
addEquation(number, number, number, number, number, number)Add an equation object to the worksheet.
addSpinner(number, number, number, number, number, number)Adds a Spinner to the worksheet.
addScrollBar(number, number, number, number, number, number)Adds a ScrollBar to the worksheet.
addRadioButton(number, number, number, number, number, number)Adds a RadioButton to the worksheet.
addListBox(number, number, number, number, number, number)Adds a ListBox to the worksheet.
addComboBox(number, number, number, number, number, number)Adds a ComboBox to the worksheet.
addGroupBox(number, number, number, number, number, number)Adds a GroupBox to the worksheet.
addButton(number, number, number, number, number, number)Adds a Button to the worksheet.
addLabel(number, number, number, number, number, number)Adds a Label to the worksheet.
addLabelInChart(number, number, number, number)Adds a label to the chart.
addTextBoxInChart(number, number, number, number)Adds a textbox to the chart.
addTextEffectInChart(MsoPresetTextEffect, string, string, number, boolean, boolean, number, number, number, number)Inserts a WordArt object to the chart
addTextEffect(MsoPresetTextEffect, string, string, number, boolean, boolean, number, number, number, number, number, number)Inserts a WordArt object.
addWordArt(PresetWordArtStyle, string, number, number, number, number, number, number)Adds preset WordArt since Excel 2007.s
addRectangle(number, number, number, number, number, number)Adds a RectangleShape to the worksheet.
addOval(number, number, number, number, number, number)Adds a Oval to the worksheet.
addLine(number, number, number, number, number, number)Adds a LineShape to the worksheet.
addFreeFloatingShape(MsoDrawingType, number, number, number, number, number[], boolean)Adds a free floating shape to the worksheet.Only applies for line/image shape.
addShapeInChart(MsoDrawingType, PlacementType, number, number, number, number, number[])Add a shape to chart .All unit is 1/4000 of chart area.
addShapeInChart(MsoDrawingType, PlacementType, number, number, number, number)Add a shape to chart .All unit is 1/4000 of chart area.
addShapeInChartByScale(MsoDrawingType, PlacementType, number, number, number, number)Add a shape to chart. All unit is percent scale of chart area.
addShapeInChartByScale(MsoDrawingType, PlacementType, number, number, number, number, number[])Add a shape to chart .All unit is 1/4000 of chart area.
addArc(number, number, number, number, number, number)Adds a ArcShape to the worksheet.
addShape(MsoDrawingType, number, number, number, number, number, number)Adds a Shape to the worksheet.
addAutoShape(AutoShapeType, number, number, number, number, number, number)Adds a AutoShape to the worksheet.
addAutoShapeInChart(AutoShapeType, number, number, number, number)Adds a AutoShape to the chart.
addActiveXControl(ControlType, number, number, number, number, number, number)Creates an Activex Control.
addPicture(number, number, number, number, Uint8Array)Adds a picture to the collection.
addPicture(number, number, Uint8Array, number, number)Adds a picture to the collection.
addSvg(number, number, number, number, number, number, number[], number[])Adds svg image.
addIcons(number, number, number, number, number, number, number[], number[])Adds svg image.
addLinkedPicture(number, number, number, number, string)Add a linked picture.
addOleObjectWithLinkedImage(number, number, number, number, string)Add a linked picture.
addPictureInChart(number, number, Uint8Array, number, number)Adds a picture to the chart.
addOleObject(number, number, number, number, number, number, number[])Adds an OleObject.
copyCommentsInRange(ShapeCollection, CellArea, number, number)Copy all comments in the range.
copyInRange(ShapeCollection, CellArea, number, number, boolean)Copy shapes in the range to destination range.
deleteInRange(CellArea)Delete shapes in the range.Comment shapes will not be deleted.
deleteShape(Shape)Delete a shape. If the shape is in the group or is a comment shape, it will not be deleted.
group(Shape[])Group the shapes.
ungroup(GroupShape)Ungroups the shape items.
removeAt(number)Remove the shape.
remove(Shape)Remove the shape.
clear()Clear all shapes in the worksheet.
updateSelectedValue()Update the selected value by the value of the linked cell or range of the shape.
getCount()Gets the number of elements contained in.
isNull()Checks whether the implementation object is null.

get(number)

Gets the Shape object at the specific index in the list.

get(index: number) : Shape;

Parameters:

ParameterTypeDescription
indexnumberThe index.

Returns

Shape

get(string)

Gets the Shape object by the name of the shape.

get(name: string) : Shape;

Parameters:

ParameterTypeDescription
namestringThe name of the shape.

Returns

Shape

addCopy(Shape, number, number, number, number)

Adds and copy a shape to the worksheet.

addCopy(sourceShape: Shape, topRow: number, top: number, leftColumn: number, left: number) : Shape;

Parameters:

ParameterTypeDescription
sourceShapeShapeSource shape.
topRownumberThe top row index.
topnumberRepresents the vertical offset from its top row, in unit of pixel.
leftColumnnumberThe left column index.
leftnumberRepresents the horizontal offset from its left column, in unit of pixel.

Returns

The new Shape object.

addCheckBox(number, number, number, number, number, number)

Adds a checkbox to the worksheet.

addCheckBox(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : CheckBox;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of checkbox from its top row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of textbox from its left column, in unit of pixel.
heightnumberHeight of textbox, in unit of pixel.
widthnumberWidth of textbox, in unit of pixel.

Returns

The new CheckBox object index.

addTextBox(number, number, number, number, number, number)

Adds a text box to the worksheet.

addTextBox(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : TextBox;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of textbox from its top row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of textbox from its left column, in unit of pixel.
heightnumberRepresents the height of textbox, in unit of pixel.
widthnumberRepresents the width of textbox, in unit of pixel.

Returns

A TextBox object.

addEquation(number, number, number, number, number, number)

Add an equation object to the worksheet.

addEquation(topRow: number, top: number, leftColumn: number, left: number, height: number, width: number) : TextBox;

Parameters:

ParameterTypeDescription
topRownumberThe top row index.
topnumberThe vertical offset its top row, in unit of pixel.
leftColumnnumberThe left column index.
leftnumberThe horizontal offset from its left column, in unit of pixel.
heightnumberThe height of equation, in unit of pixel.
widthnumberThe width of equation, in unit of pixel.

Returns

TextBox

addSpinner(number, number, number, number, number, number)

Adds a Spinner to the worksheet.

addSpinner(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Spinner;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of Spinner from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of Spinner from its left column, in unit of pixel.
heightnumberRepresents the height of Spinner, in unit of pixel.
widthnumberRepresents the width of Spinner, in unit of pixel.

Returns

A Spinner object.

addScrollBar(number, number, number, number, number, number)

Adds a ScrollBar to the worksheet.

addScrollBar(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : ScrollBar;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of ScrollBar from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of ScrollBar from its left column, in unit of pixel.
heightnumberRepresents the height of ScrollBar, in unit of pixel.
widthnumberRepresents the width of ScrollBar, in unit of pixel.

Returns

A ScrollBar object.

addRadioButton(number, number, number, number, number, number)

Adds a RadioButton to the worksheet.

addRadioButton(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : RadioButton;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of RadioButton from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of RadioButton from its left column, in unit of pixel.
heightnumberRepresents the height of RadioButton, in unit of pixel.
widthnumberRepresents the width of RadioButton, in unit of pixel.

Returns

A RadioButton object.

addListBox(number, number, number, number, number, number)

Adds a ListBox to the worksheet.

addListBox(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : ListBox;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of ListBox from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of ListBox from its left column, in unit of pixel.
heightnumberRepresents the height of ListBox, in unit of pixel.
widthnumberRepresents the width of ListBox, in unit of pixel.

Returns

A ListBox object.

addComboBox(number, number, number, number, number, number)

Adds a ComboBox to the worksheet.

addComboBox(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : ComboBox;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of ComboBox from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of ComboBox from its left column, in unit of pixel.
heightnumberRepresents the height of ComboBox, in unit of pixel.
widthnumberRepresents the width of ComboBox, in unit of pixel.

Returns

A ComboBox object.

addGroupBox(number, number, number, number, number, number)

Adds a GroupBox to the worksheet.

addGroupBox(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : GroupBox;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of GroupBox from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of GroupBox from its left column, in unit of pixel.
heightnumberRepresents the height of GroupBox, in unit of pixel.
widthnumberRepresents the width of GroupBox, in unit of pixel.

Returns

A GroupBox object.

addButton(number, number, number, number, number, number)

Adds a Button to the worksheet.

addButton(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Button;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of Button from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of Button from its left column, in unit of pixel.
heightnumberRepresents the height of Button, in unit of pixel.
widthnumberRepresents the width of Button, in unit of pixel.

Returns

A Button object.

addLabel(number, number, number, number, number, number)

Adds a Label to the worksheet.

addLabel(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Label;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of Label from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of Label from its left column, in unit of pixel.
heightnumberRepresents the height of Label, in unit of pixel.
widthnumberRepresents the width of Label, in unit of pixel.

Returns

A Label object.

addLabelInChart(number, number, number, number)

Adds a label to the chart.

addLabelInChart(top: number, left: number, height: number, width: number) : Label;

Parameters:

ParameterTypeDescription
topnumberRepresents the vertical offset of label from the upper left corner in units of 1/4000 of the chart area.
leftnumberRepresents the vertical offset of label from the upper left corner in units of 1/4000 of the chart area.
heightnumberRepresents the height of label, in units of 1/4000 of the chart area.
widthnumberRepresents the width of label, in units of 1/4000 of the chart area.

Returns

A new Label object.

addTextBoxInChart(number, number, number, number)

Adds a textbox to the chart.

addTextBoxInChart(top: number, left: number, height: number, width: number) : TextBox;

Parameters:

ParameterTypeDescription
topnumberRepresents the vertical offset of textbox from the upper left corner in units of 1/4000 of the chart area.
leftnumberRepresents the vertical offset of textbox from the upper left corner in units of 1/4000 of the chart area.
heightnumberRepresents the height of textbox, in units of 1/4000 of the chart area.
widthnumberRepresents the width of textbox, in units of 1/4000 of the chart area.

Returns

A TextBox object.

addTextEffectInChart(MsoPresetTextEffect, string, string, number, boolean, boolean, number, number, number, number)

Inserts a WordArt object to the chart

addTextEffectInChart(effect: MsoPresetTextEffect, text: string, fontName: string, size: number, fontBold: boolean, fontItalic: boolean, top: number, left: number, height: number, width: number) : Shape;

Parameters:

ParameterTypeDescription
effectMsoPresetTextEffectThe mso preset text effect type.
textstringThe WordArt text.
fontNamestringThe font name.
sizenumberThe font size
fontBoldbooleanIndicates whether font is bold.
fontItalicbooleanIndicates whether font is italic.
topnumberRepresents the vertical offset of shape from the upper left corner in units of 1/4000 of the chart area.
leftnumberRepresents the vertical offset of shape from the upper left corner in units of 1/4000 of the chart area.
heightnumberRepresents the height of shape, in units of 1/4000 of the chart area.
widthnumberRepresents the width of shape, in units of 1/4000 of the chart area.

Returns

Returns a Shape object that represents the new WordArt object.

addTextEffect(MsoPresetTextEffect, string, string, number, boolean, boolean, number, number, number, number, number, number)

Inserts a WordArt object.

addTextEffect(effect: MsoPresetTextEffect, text: string, fontName: string, size: number, fontBold: boolean, fontItalic: boolean, upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Shape;

Parameters:

ParameterTypeDescription
effectMsoPresetTextEffectThe mso preset text effect type.
textstringThe WordArt text.
fontNamestringThe font name.
sizenumberThe font size
fontBoldbooleanIndicates whether font is bold.
fontItalicbooleanIndicates whether font is italic.
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of shape from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of shape from its left column, in unit of pixel.
heightnumberRepresents the height of shape, in unit of pixel.
widthnumberRepresents the width of shape, in unit of pixel.

Returns

Returns a Shape object that represents the new WordArt object.

addWordArt(PresetWordArtStyle, string, number, number, number, number, number, number)

Adds preset WordArt since Excel 2007.s

addWordArt(style: PresetWordArtStyle, text: string, upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Shape;

Parameters:

ParameterTypeDescription
stylePresetWordArtStyleThe preset WordArt Style.
textstringThe text.
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of shape from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of shape from its left column, in unit of pixel.
heightnumberRepresents the height of shape, in unit of pixel.
widthnumberRepresents the width of shape, in unit of pixel.

Returns

Shape

addRectangle(number, number, number, number, number, number)

Adds a RectangleShape to the worksheet.

addRectangle(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : RectangleShape;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of RectangleShape from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of RectangleShape from its left column, in unit of pixel.
heightnumberRepresents the height of RectangleShape, in unit of pixel.
widthnumberRepresents the width of RectangleShape, in unit of pixel.

Returns

A RectangleShape object.

addOval(number, number, number, number, number, number)

Adds a Oval to the worksheet.

addOval(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Oval;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of Oval from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of Oval from its left column, in unit of pixel.
heightnumberRepresents the height of Oval, in unit of pixel.
widthnumberRepresents the width of Oval, in unit of pixel.

Returns

A Oval object.

addLine(number, number, number, number, number, number)

Adds a LineShape to the worksheet.

addLine(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : LineShape;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of LineShape from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of LineShape from its left column, in unit of pixel.
heightnumberRepresents the height of LineShape, in unit of pixel.
widthnumberRepresents the width of LineShape, in unit of pixel.

Returns

A LineShape object.

addFreeFloatingShape(MsoDrawingType, number, number, number, number, number[], boolean)

Adds a free floating shape to the worksheet.Only applies for line/image shape.

addFreeFloatingShape(type: MsoDrawingType, top: number, left: number, height: number, width: number, imageData: number[], isOriginalSize: boolean) : Shape;

Parameters:

ParameterTypeDescription
typeMsoDrawingTypeThe shape type.
topnumberRepresents the vertical offset of shape from the worksheet’s top row, in unit of pixel.
leftnumberRepresents the horizontal offset of shape from the worksheet’s left column, in unit of pixel.
heightnumberRepresents the height of LineShape, in unit of pixel.
widthnumberRepresents the width of LineShape, in unit of pixel.
imageDatanumber[]The image data,only applies for the picture.
isOriginalSizebooleanWhether the shape use original size if the shape is image.

Returns

Shape

addShapeInChart(MsoDrawingType, PlacementType, number, number, number, number, number[])

Add a shape to chart .All unit is 1/4000 of chart area.

addShapeInChart(type: MsoDrawingType, placement: PlacementType, left: number, top: number, right: number, bottom: number, imageData: number[]) : Shape;

Parameters:

ParameterTypeDescription
typeMsoDrawingTypeThe drawing type.
placementPlacementTypethe placement type.
leftnumberIn unit of 1/4000 chart area width.
topnumberIn unit of 1/4000 chart area height.
rightnumberIn unit of 1/4000 chart area width.
bottomnumberIn unit of 1/4000 chart area height.
imageDatanumber[]If the shape is not a picture or ole object,imageData should be null.

Returns

Shape

addShapeInChart(MsoDrawingType, PlacementType, number, number, number, number)

Add a shape to chart .All unit is 1/4000 of chart area.

addShapeInChart(type: MsoDrawingType, placement: PlacementType, left: number, top: number, right: number, bottom: number) : Shape;

Parameters:

ParameterTypeDescription
typeMsoDrawingTypeThe drawing type.
placementPlacementTypethe placement type.
leftnumberIn unit of 1/4000 chart area width.
topnumberIn unit of 1/4000 chart area height.
rightnumberIn unit of 1/4000 chart area width.
bottomnumberIn unit of 1/4000 chart area height.

Returns

Shape

addShapeInChartByScale(MsoDrawingType, PlacementType, number, number, number, number)

Add a shape to chart. All unit is percent scale of chart area.

addShapeInChartByScale(type: MsoDrawingType, placement: PlacementType, left: number, top: number, right: number, bottom: number) : Shape;

Parameters:

ParameterTypeDescription
typeMsoDrawingTypeThe drawing type.
placementPlacementTypethe placement type.
leftnumberUnit is percent scale of chart area width.
topnumberUnit is percent scale of chart area height.
rightnumberUnit is percent scale of chart area width.
bottomnumberUnit is percent scale of chart area height.

Returns

Shape

addShapeInChartByScale(MsoDrawingType, PlacementType, number, number, number, number, number[])

Add a shape to chart .All unit is 1/4000 of chart area.

addShapeInChartByScale(type: MsoDrawingType, placement: PlacementType, left: number, top: number, right: number, bottom: number, imageData: number[]) : Shape;

Parameters:

ParameterTypeDescription
typeMsoDrawingTypeThe drawing type.
placementPlacementTypethe placement type.
leftnumberUnit is percent scale of chart area width.
topnumberUnit is percent scale of chart area height.
rightnumberUnit is percent scale of chart area width.
bottomnumberUnit is percent scale of chart area height.
imageDatanumber[]If the shape is not a picture or ole object,imageData should be null.

Returns

Shape

addArc(number, number, number, number, number, number)

Adds a ArcShape to the worksheet.

addArc(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : ArcShape;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of ArcShape from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of ArcShape from its left column, in unit of pixel.
heightnumberRepresents the height of ArcShape, in unit of pixel.
widthnumberRepresents the width of ArcShape, in unit of pixel.

Returns

A ArcShape object.

addShape(MsoDrawingType, number, number, number, number, number, number)

Adds a Shape to the worksheet.

addShape(type: MsoDrawingType, upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Shape;

Parameters:

ParameterTypeDescription
typeMsoDrawingTypeMso drawing type.
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of Shape from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of Shape from its left column, in unit of pixel.
heightnumberRepresents the height of Shape, in unit of pixel.
widthnumberRepresents the width of Shape, in unit of pixel.

Returns

A Shape object.

Remarks

The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox

addAutoShape(AutoShapeType, number, number, number, number, number, number)

Adds a AutoShape to the worksheet.

addAutoShape(type: AutoShapeType, upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number) : Shape;

Parameters:

ParameterTypeDescription
typeAutoShapeTypeAuto shape type.
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of Shape from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of Shape from its left column, in unit of pixel.
heightnumberRepresents the height of Shape, in unit of pixel.
widthnumberRepresents the width of Shape, in unit of pixel.

Returns

A Shape object.

Remarks

The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox

addAutoShapeInChart(AutoShapeType, number, number, number, number)

Adds a AutoShape to the chart.

addAutoShapeInChart(type: AutoShapeType, top: number, left: number, height: number, width: number) : Shape;

Parameters:

ParameterTypeDescription
typeAutoShapeTypeAuto shape type.
topnumberRepresents the vertical offset of textbox from the upper left corner in units of 1/4000 of the chart area.
leftnumberRepresents the vertical offset of textbox from the upper left corner in units of 1/4000 of the chart area.
heightnumberRepresents the height of textbox, in units of 1/4000 of the chart area.
widthnumberRepresents the width of textbox, in units of 1/4000 of the chart area.

Returns

Returns a shape object.

Remarks

The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox

addActiveXControl(ControlType, number, number, number, number, number, number)

Creates an Activex Control.

addActiveXControl(type: ControlType, topRow: number, top: number, leftColumn: number, left: number, width: number, height: number) : Shape;

Parameters:

ParameterTypeDescription
typeControlTypeThe type of the control.
topRownumberUpper left row index.
topnumberRepresents the vertical offset of Shape from its left row, in unit of pixel.
leftColumnnumberUpper left column index.
leftnumberRepresents the horizontal offset of Shape from its left column, in unit of pixel.
widthnumberRepresents the width of Shape, in unit of pixel.
heightnumberRepresents the height of Shape, in unit of pixel.

Returns

Shape

addPicture(number, number, number, number, Uint8Array)

Adds a picture to the collection.

addPicture(upperLeftRow: number, upperLeftColumn: number, lowerRightRow: number, lowerRightColumn: number, stream: Uint8Array) : Picture;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
upperLeftColumnnumberUpper left column index.
lowerRightRownumberLower right row index
lowerRightColumnnumberLower right column index
streamUint8ArrayStream object which contains the image data.

Returns

Picture Picture object.

addPicture(number, number, Uint8Array, number, number)

Adds a picture to the collection.

addPicture(upperLeftRow: number, upperLeftColumn: number, stream: Uint8Array, widthScale: number, heightScale: number) : Picture;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
upperLeftColumnnumberUpper left column index.
streamUint8ArrayStream object which contains the image data.
widthScalenumberScale of image width, a percentage.
heightScalenumberScale of image height, a percentage.

Returns

Picture Picture object.

addSvg(number, number, number, number, number, number, number[], number[])

Adds svg image.

addSvg(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number, svgData: number[], compatibleImageData: number[]) : Picture;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of shape from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberThe horizontal offset of shape from its left column, in unit of pixel.
heightnumberThe height of shape, in unit of pixel.
widthnumberThe width of shape, in unit of pixel.
svgDatanumber[]The svg image data.
compatibleImageDatanumber[]Converted image data from svg in order to be compatible with Excel 2016 or lower versions.

Returns

Picture

addIcons(number, number, number, number, number, number, number[], number[])

Adds svg image.

addIcons(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number, imageByteData: number[], compatibleImageData: number[]) : Picture;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
topnumberRepresents the vertical offset of shape from its left row, in unit of pixel.
upperLeftColumnnumberUpper left column index.
leftnumberThe horizontal offset of shape from its left column, in unit of pixel.
heightnumberThe height of shape, in unit of pixel.
widthnumberThe width of shape, in unit of pixel.
imageByteDatanumber[]The image byte data.
compatibleImageDatanumber[]Converted image data from svg in order to be compatible with Excel 2016 or lower versions.

Returns

Picture

addLinkedPicture(number, number, number, number, string)

Add a linked picture.

addLinkedPicture(upperLeftRow: number, upperLeftColumn: number, height: number, width: number, sourceFullName: string) : Picture;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
upperLeftColumnnumberUpper left column index.
heightnumberThe height of the shape. In unit of pixels
widthnumberThe width of the shape. In unit of pixels
sourceFullNamestringThe path and name of the source file for the linked image

Returns

Picture Picture object.

addOleObjectWithLinkedImage(number, number, number, number, string)

Add a linked picture.

addOleObjectWithLinkedImage(upperLeftRow: number, upperLeftColumn: number, height: number, width: number, sourceFullName: string) : OleObject;

Parameters:

ParameterTypeDescription
upperLeftRownumberUpper left row index.
upperLeftColumnnumberUpper left column index.
heightnumberThe height of the shape. In unit of pixels
widthnumberThe width of the shape. In unit of pixels
sourceFullNamestringThe path and name of the source file for the linked image

Returns

Picture Picture object.

addPictureInChart(number, number, Uint8Array, number, number)

Adds a picture to the chart.

addPictureInChart(top: number, left: number, stream: Uint8Array, widthScale: number, heightScale: number) : Picture;

Parameters:

ParameterTypeDescription
topnumberRepresents the vertical offset of shape from the upper left corner in units of 1/4000 of the chart area.
leftnumberRepresents the horizontal offset of shape from the upper left corner in units of 1/4000 of the chart area.
streamUint8ArrayStream object which contains the image data.
widthScalenumberScale of image width, a percentage.
heightScalenumberScale of image height, a percentage.

Returns

Returns a Picture object.

addOleObject(number, number, number, number, number, number, number[])

Adds an OleObject.

addOleObject(upperLeftRow: number, top: number, upperLeftColumn: number, left: number, height: number, width: number, imageData: number[]) : OleObject;

Parameters:

ParameterTypeDescription
upperLeftRownumber
topnumber
upperLeftColumnnumber
leftnumber
heightnumber
widthnumber
imageDatanumber[]

Returns

OleObject

copyCommentsInRange(ShapeCollection, CellArea, number, number)

Copy all comments in the range.

copyCommentsInRange(shapes: ShapeCollection, ca: CellArea, destRow: number, destColumn: number) : void;

Parameters:

ParameterTypeDescription
shapesShapeCollectionThe source shapes.
caCellAreaThe source range.
destRownumberThe dest range start row.
destColumnnumberThe dest range start column.

copyInRange(ShapeCollection, CellArea, number, number, boolean)

Copy shapes in the range to destination range.

copyInRange(sourceShapes: ShapeCollection, ca: CellArea, destRow: number, destColumn: number, isContained: boolean) : void;

Parameters:

ParameterTypeDescription
sourceShapesShapeCollectionSource shapes.
caCellAreaThe source range.
destRownumberThe dest row index of the dest range.
destColumnnumberThe dest column of the dest range.
isContainedbooleanWhether only copy the shapes which are contained in the range. /// If true,only copies the shapes in the range. /// Otherwise,it works as MS Office.

deleteInRange(CellArea)

Delete shapes in the range.Comment shapes will not be deleted.

deleteInRange(ca: CellArea) : void;

Parameters:

ParameterTypeDescription
caCellAreaThe range.If the shapes are contained in the range, they will be removed.

deleteShape(Shape)

Delete a shape. If the shape is in the group or is a comment shape, it will not be deleted.

deleteShape(shape: Shape) : void;

Parameters:

ParameterTypeDescription
shapeShape

group(Shape[])

Group the shapes.

group(groupItems: Shape[]) : GroupShape;

Parameters:

ParameterTypeDescription
groupItemsShape[]the group items.

Returns

Return the group shape.

Remarks

The shape in the groupItems should not be grouped. The shape must be in this Shapes collection.

ungroup(GroupShape)

Ungroups the shape items.

ungroup(group: GroupShape) : void;

Parameters:

ParameterTypeDescription
groupGroupShapeThe group shape.

Remarks

If the group shape is grouped by another group shape,nothing will be done.

removeAt(number)

Remove the shape.

removeAt(index: number) : void;

Parameters:

ParameterTypeDescription
indexnumberThe index of the shape.

remove(Shape)

Remove the shape.

remove(shape: Shape) : void;

Parameters:

ParameterTypeDescription
shapeShape

clear()

Clear all shapes in the worksheet.

clear() : void;

updateSelectedValue()

Update the selected value by the value of the linked cell or range of the shape.

updateSelectedValue() : void;

getCount()

Gets the number of elements contained in.

getCount() : number;

isNull()

Checks whether the implementation object is null.

isNull() : boolean;