ShapeCollection

ShapeCollection class

Represents all the shape in a worksheet/chart.

Methods

NameDescription
addActiveXControl(type, topRow, top, leftColumn, left, height, width)Creates an Activex Control.
addArc(upperLeftRow, top, upperLeftColumn, left, height, width)Adds a ArcShape to the worksheet.
addAutoShape(type, upperLeftRow, top, upperLeftColumn, left, height, width)Adds a AutoShape to the worksheet. The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox
addAutoShapeInChart(type, top, left, height, width)Adds a AutoShape to the chart. The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox
addButton(upperLeftRow, top, upperLeftColumn, left, height, width)Adds a Button to the worksheet.
addCheckBox(upperLeftRow, top, upperLeftColumn, left, height, width)Adds a checkbox to the worksheet.
addComboBox(upperLeftRow, top, upperLeftColumn, left, height, width)Adds a ComboBox to the worksheet.
addCopy(sourceShape, topRow, top, leftColumn, left)Adds and copy a shape to the worksheet.
addCopy()
addEquation(topRow, top, leftColumn, left, height, width)Add an equation object to the worksheet.
addFreeFloatingShape(type, top, left, height, width, imageData, isOriginalSize)Adds a free floating shape to the worksheet.Only applies for line/image shape.
addFreeform()
addGroupBox(upperLeftRow, top, upperLeftColumn, left, height, width)Adds a GroupBox to the worksheet.
addIcons(upperLeftRow, top, upperLeftColumn, left, height, width, imageByteData, compatibleImageData)Adds svg image.
addLaTeXEquation()
addLabel(upperLeftRow, top, upperLeftColumn, left, height, width)Adds a Label to the worksheet.
addLabelInChart(top, left, height, width)Adds a label to the chart.
addLine(upperLeftRow, top, upperLeftColumn, left, height, width)Adds a LineShape to the worksheet.
addLinkedPicture(upperLeftRow, upperLeftColumn, height, width, sourceFullName)Add a linked picture.
addListBox(upperLeftRow, top, upperLeftColumn, left, height, width)Adds a ListBox to the worksheet.
addOleObject(upperLeftRow, top, upperLeftColumn, left, height, width, imageData)Adds an OleObject.
addOleObjectWithLinkedImage(upperLeftRow, upperLeftColumn, height, width, sourceFullName)Add a linked picture.
addOval(upperLeftRow, top, upperLeftColumn, left, height, width)Adds a Oval to the worksheet.
addRadioButton(upperLeftRow, top, upperLeftColumn, left, height, width)Adds a RadioButton to the worksheet.
addRectangle(upperLeftRow, top, upperLeftColumn, left, height, width)Adds a RectangleShape to the worksheet.
addScrollBar(upperLeftRow, top, upperLeftColumn, left, height, width)Adds a ScrollBar to the worksheet.
addShape(type, upperLeftRow, top, upperLeftColumn, left, height, width)Adds a Shape to the worksheet. The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox
addShapeInChart(type, placement, left, top, right, bottom, imageData)Add a shape to chart .All unit is 1/4000 of chart area.
addShapeInChart(type, placement, left, top, right, bottom)Add a shape to chart .All unit is 1/4000 of chart area.
addShapeInChartByScale(type, placement, left, top, right, bottom)Add a shape to chart. All unit is percent scale of chart area.
addShapeInChartByScale(type, placement, left, top, right, bottom, imageData)Add a shape to chart .All unit is 1/4000 of chart area.
addSignatureLine()
addSpinner(upperLeftRow, top, upperLeftColumn, left, height, width)Adds a Spinner to the worksheet.
addSvg(upperLeftRow, top, upperLeftColumn, left, height, width, svgData, compatibleImageData)Adds svg image.
addTextBox(upperLeftRow, top, upperLeftColumn, left, height, width)Adds a text box to the worksheet.
addTextBoxInChart(top, left, height, width)Adds a textbox to the chart.
addTextEffect(effect, text, fontName, size, fontBold, fontItalic, upperLeftRow, top, upperLeftColumn, left, height, width)Inserts a WordArt object.
addTextEffectInChart(effect, text, fontName, size, fontBold, fontItalic, top, left, height, width)Inserts a WordArt object to the chart
addWordArt(style, text, upperLeftRow, top, upperLeftColumn, left, height, width)Adds preset WordArt since Excel 2007.s
clear()Clear all shapes in the worksheet.
contains()Reserved for internal use.
copyCommentsInRange(shapes, ca, destRow, destColumn)Copy all comments in the range.
copyInRange(sourceShapes, ca, destRow, destColumn, isContained)Copy shapes in the range to destination range.
deleteInRange(ca)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.
get(index)Gets the Shape object at the specific index in the list.
get(name)Gets the Shape object by the name of the shape.
get()Reserved for internal use.
getCount()
group(groupItems)Group the shapes. The shape in the groupItems should not be grouped. The shape must be in this Shapes collection.
indexOf()Reserved for internal use.
iterator()
remove(shape)Remove the shape.
removeAt(index)Remove the shape.
ungroup(group)Ungroups the shape items. If the group shape is grouped by another group shape,nothing will be done.
updateSelectedValue()Update the selected value by the value of the linked cell or range of the shape.
addPictureFromStream(pictures, upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn, stream, callback) (static)Adds a picture to the collection.
addPictureFromStream(pictures, upperLeftRow, upperLeftColumn, stream, widthScale, heightScale, callback) (static)Adds a picture to the collection.
addPictureInChartFromStream(pictures, top, left, stream, widthScale, heightScale, callback) (static)Adds a picture to the chart.

addActiveXControl(type, topRow, top, leftColumn, left, height, width)

Creates an Activex Control.

ParameterTypeDescription
typeNumberControlType
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.
heightNumberRepresents the height of Shape, in unit of pixel.
widthNumberRepresents the width of Shape, in unit of pixel.

Returns: Shape — Shape

addArc(upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a ArcShape to the worksheet.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of ArcShape from its left row, in unit of pixel.
upperLeftColumnUpper 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: ArcShape — ArcShape A ArcShape object.

addAutoShape(type, upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a AutoShape to the worksheet. The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox

ParameterTypeDescription
typeNumberAutoShapeType
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of Shape from its left row, in unit of pixel.
upperLeftColumnUpper 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 — Shape A Shape object.

addAutoShapeInChart(type, top, left, height, width)

Adds a AutoShape to the chart. The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox

ParameterTypeDescription
typeNumberAutoShapeType
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: Shape — Shape Returns a shape object.

addButton(upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a Button to the worksheet.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of Button from its left row, in unit of pixel.
upperLeftColumnUpper 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: Button — Button A Button object.

addCheckBox(upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a checkbox to the worksheet.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of checkbox from its top row, in unit of pixel.
upperLeftColumnUpper 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: CheckBox — CheckBox The new CheckBox object index.

addComboBox(upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a ComboBox to the worksheet.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of ComboBox from its left row, in unit of pixel.
upperLeftColumnUpper 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: ComboBox — ComboBox A ComboBox object.

addCopy(sourceShape, topRow, top, leftColumn, left)

Adds and copy a shape to the worksheet.

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: Shape — Shape The new Shape object.

addCopy()

addEquation(topRow, top, leftColumn, left, height, width)

Add an equation object to the worksheet.

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 — TextBox

addFreeFloatingShape(type, top, left, height, width, imageData, isOriginalSize)

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

ParameterTypeDescription
typeNumberMsoDrawingType
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.
imageDataArray of byteThe image data,only applies for the picture.
isOriginalSizebooleanWhether the shape use original size if the shape is image.

Returns: Shape — Shape

addFreeform()

addGroupBox(upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a GroupBox to the worksheet.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of GroupBox from its left row, in unit of pixel.
upperLeftColumnUpper 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: GroupBox — GroupBox A GroupBox object.

addIcons(upperLeftRow, top, upperLeftColumn, left, height, width, imageByteData, compatibleImageData)

Adds svg image.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of shape from its left row, in unit of pixel.
upperLeftColumnUpper 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.
imageByteDataArray of byteThe image byte data.
compatibleImageDataArray of byteConverted image data from svg in order to be compatible with Excel 2016 or lower versions.

Returns: Picture — Picture

addLaTeXEquation()

addLabel(upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a Label to the worksheet.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of Label from its left row, in unit of pixel.
upperLeftColumnUpper 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: Label — Label A Label object.

addLabelInChart(top, left, height, width)

Adds a label to the chart.

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: Label — Label A new Label object.

addLine(upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a LineShape to the worksheet.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of LineShape from its left row, in unit of pixel.
upperLeftColumnUpper 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: LineShape — LineShape A LineShape object.

addLinkedPicture(upperLeftRow, upperLeftColumn, height, width, sourceFullName)

Add a linked picture.

ParameterTypeDescription
upperLeftRowUpper left row index.
upperLeftColumnUpper 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 Picture Picture object.

addListBox(upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a ListBox to the worksheet.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of ListBox from its left row, in unit of pixel.
upperLeftColumnUpper 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: ListBox — ListBox A ListBox object.

addOleObject(upperLeftRow, top, upperLeftColumn, left, height, width, imageData)

Adds an OleObject.

ParameterTypeDescription
upperLeftRow
topNumber
upperLeftColumn
leftNumber
heightNumber
widthNumber
imageDataArray of byte

Returns: OleObject — OleObject

addOleObjectWithLinkedImage(upperLeftRow, upperLeftColumn, height, width, sourceFullName)

Add a linked picture.

ParameterTypeDescription
upperLeftRowUpper left row index.
upperLeftColumnUpper 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: OleObject — OleObject Picture Picture object.

addOval(upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a Oval to the worksheet.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of Oval from its left row, in unit of pixel.
upperLeftColumnUpper 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: Oval — Oval A Oval object.

addRadioButton(upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a RadioButton to the worksheet.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of RadioButton from its left row, in unit of pixel.
upperLeftColumnUpper 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: RadioButton — RadioButton A RadioButton object.

addRectangle(upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a RectangleShape to the worksheet.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of RectangleShape from its left row, in unit of pixel.
upperLeftColumnUpper 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: RectangleShape — RectangleShape A RectangleShape object.

addScrollBar(upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a ScrollBar to the worksheet.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of ScrollBar from its left row, in unit of pixel.
upperLeftColumnUpper 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: ScrollBar — ScrollBar A ScrollBar object.

addShape(type, upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a Shape to the worksheet. The type could not be Chart/Comment/Picture/OleObject/Polygon/DialogBox

ParameterTypeDescription
typeNumberMsoDrawingType
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of Shape from its left row, in unit of pixel.
upperLeftColumnUpper 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 — Shape A Shape object.

addShapeInChart(type, placement, left, top, right, bottom, imageData)

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

ParameterTypeDescription
typeNumberMsoDrawingType
placementNumberPlacementType
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.
imageDataArray of byteIf the shape is not a picture or ole object,imageData should be null.

addShapeInChart(type, placement, left, top, right, bottom)

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

ParameterTypeDescription
typeNumberMsoDrawingType
placementNumberPlacementType
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.

addShapeInChartByScale(type, placement, left, top, right, bottom)

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

ParameterTypeDescription
typeNumberMsoDrawingType
placementNumberPlacementType
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.

addShapeInChartByScale(type, placement, left, top, right, bottom, imageData)

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

ParameterTypeDescription
typeNumberMsoDrawingType
placementNumberPlacementType
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.
imageDataArray of byteIf the shape is not a picture or ole object,imageData should be null.

addSignatureLine()

addSpinner(upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a Spinner to the worksheet.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of Spinner from its left row, in unit of pixel.
upperLeftColumnUpper 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: Spinner — Spinner A Spinner object.

addSvg(upperLeftRow, top, upperLeftColumn, left, height, width, svgData, compatibleImageData)

Adds svg image.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of shape from its left row, in unit of pixel.
upperLeftColumnUpper 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.
svgDataArray of byteThe svg image data.
compatibleImageDataArray of byteConverted image data from svg in order to be compatible with Excel 2016 or lower versions.

Returns: Picture — Picture

addTextBox(upperLeftRow, top, upperLeftColumn, left, height, width)

Adds a text box to the worksheet.

ParameterTypeDescription
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of textbox from its top row, in unit of pixel.
upperLeftColumnUpper 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: TextBox — TextBox A TextBox object.

addTextBoxInChart(top, left, height, width)

Adds a textbox to the chart.

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: TextBox — TextBox A TextBox object.

addTextEffect(effect, text, fontName, size, fontBold, fontItalic, upperLeftRow, top, upperLeftColumn, left, height, width)

Inserts a WordArt object.

ParameterTypeDescription
effectNumberMsoPresetTextEffect
textStringThe WordArt text.
fontNameStringThe font name.
sizeNumberThe font size
fontBoldbooleanIndicates whether font is bold.
fontItalicbooleanIndicates whether font is italic.
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of shape from its left row, in unit of pixel.
upperLeftColumnUpper 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 — Shape Returns a Shape object that represents the new WordArt object.

addTextEffectInChart(effect, text, fontName, size, fontBold, fontItalic, top, left, height, width)

Inserts a WordArt object to the chart

ParameterTypeDescription
effectNumberMsoPresetTextEffect
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: Shape — Shape Returns a Shape object that represents the new WordArt object.

addWordArt(style, text, upperLeftRow, top, upperLeftColumn, left, height, width)

Adds preset WordArt since Excel 2007.s

ParameterTypeDescription
styleNumberPresetWordArtStyle
textStringThe text.
upperLeftRowUpper left row index.
topNumberRepresents the vertical offset of shape from its left row, in unit of pixel.
upperLeftColumnUpper 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 — Shape

clear()

Clear all shapes in the worksheet.

contains()

Reserved for internal use.

copyCommentsInRange(shapes, ca, destRow, destColumn)

Copy all comments in the range.

ParameterTypeDescription
shapesShapeCollectionThe source shapes.
caCellAreaThe source range.
destRowNumberThe dest range start row.
destColumnNumberThe dest range start column.

copyInRange(sourceShapes, ca, destRow, destColumn, isContained)

Copy shapes in the range to destination range.

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(ca)

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

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.

ParameterTypeDescription
shapeShape

get(index)

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

ParameterTypeDescription
indexNumberThe index.

Returns: Shape — Shape

get(name)

Gets the Shape object by the name of the shape.

ParameterTypeDescription
nameStringThe name of the shape.

Returns: Shape — Shape

get()

Reserved for internal use.

getCount()

group(groupItems)

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

ParameterTypeDescription
groupItemsArray ofShapethe group items.

Returns: GroupShape — GroupShape Return the group shape.

indexOf()

Reserved for internal use.

iterator()

remove(shape)

Remove the shape.

ParameterTypeDescription
shapeShape

removeAt(index)

Remove the shape.

ParameterTypeDescription
indexNumberThe index of the shape.

ungroup(group)

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

ParameterTypeDescription
groupGroupShapeThe group shape.

updateSelectedValue()

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

addPictureFromStream(pictures, upperLeftRow, upperLeftColumn, lowerRightRow, lowerRightColumn, stream, callback) (static)

Adds a picture to the collection.

ParameterTypeDescription
picturesPictureCollectionThe PictureCollection object
upperLeftRowNumberUpper left row index
upperLeftColumnNumberUpper left column index
lowerRightRowNumberLower right row index
lowerRightColumnNumberLower right column index
streamReadableStreamStream object which contains the image data
callbackCallbackThe callback function

Returns: object — object Returns a Picture objct

Example:

var aspose = aspose || {};
aspose.cells = require("aspose.cells");
var fs = require("fs");
var workbook = new aspose.cells.Workbook();
var shapes = workbook.getWorksheets().get(0).getShapes();
var shapeStream = fs.createReadStream("boxing.PNG");
aspose.cells.ShapeCollection.addPictureFromStream(shapes, 1, 1, 10, 5, shapeStream,
function(picture, err) {
if (!err) {
console.log("addPictureFromStream done");
}
workbook.save('result.xlsx');
}
);

addPictureFromStream(pictures, upperLeftRow, upperLeftColumn, stream, widthScale, heightScale, callback) (static)

Adds a picture to the collection.

ParameterTypeDescription
picturesPictureCollectionThe PictureCollection object
upperLeftRowNumberUpper left row index
upperLeftColumnNumberUpper left column index
streamReadableStreamStream object which contains the image data
widthScaleNumberScale of image width, a percentage
heightScaleNumberScale of image height, a percentage
callbackCallbackThe callback function

Returns: object — object Returns a Picture objct

Example:

var aspose = aspose || {};
aspose.cells = require("aspose.cells");
var fs = require("fs");
var workbook = new aspose.cells.Workbook();
var shapes = workbook.getWorksheets().get(0).getShapes();
var shapeStream = fs.createReadStream("boxing.PNG");
aspose.cells.ShapeCollection.addPictureFromStream(shapes, 1, 1, shapeStream, 80, 60,
function(picture, err) {
if (!err) {
console.log("addPictureFromStream done");
}
workbook.save('result.xlsx');
}
);

addPictureInChartFromStream(pictures, top, left, stream, widthScale, heightScale, callback) (static)

Adds a picture to the chart.

ParameterTypeDescription
picturesPictureCollectionThe PictureCollection object
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
streamReadableStreamStream object which contains the image data
widthScaleNumberScale of image width, a percentage
heightScaleNumberScale of image height, a percentage
callbackCallbackThe callback function

Returns: object — object Returns a Picture objct

Example:

var aspose = aspose || {};
aspose.cells = require("aspose.cells");
var fs = require("fs");
var workbook = new aspose.cells.Workbook("Book2.xlsx");
var shapes = workbook.getWorksheets().get("Chart").getCharts().get(0).getShapes();
var shapeStream = fs.createReadStream("boxing.PNG");
aspose.cells.ShapeCollection.addPictureInChartFromStream(shapes, 1, 1, shapeStream, 10, 5,
function(picture, err) {
if (!err) {
console.log("addPictureInChartFromStream done");
}
workbook.save('result.xlsx');
}
);