ShapeCollection class

ShapeCollection class

Represents all the shape in a worksheet/chart.

The ShapeCollection type exposes the following members:

Properties

PropertyDescription
capacityGets or sets the number of elements that the array list can contain.

Methods

MethodDescription
add_shape_in_chartAdd a shape to chart .All unit is 1/4000 of chart area.
add_shape_in_chartAdd a shape to chart .All unit is 1/4000 of chart area.
add_shape_in_chart_by_scaleAdd a shape to chart. All unit is percent scale of chart area.
add_shape_in_chart_by_scaleAdd a shape to chart .All unit is 1/4000 of chart area.
add_pictureAdds a picture to the collection.
add_pictureAdds a picture to the collection.
copy_toCopies the entire array list to a compatible one-dimensional array list, starting at the beginning of the target array list.
copy_toCopies a range of elements from the array list to a compatible one-dimensional array list, starting at the specified index of the target array list.
index_ofSearches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the array list that extends from the specified index to the last element.
index_ofSearches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the array list that starts at the specified index and contains the specified number of elements.
last_index_ofSearches for the specified object and returns the zero-based index of the last occurrence within the entire array list.
last_index_ofSearches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the array list that extends from the first element to the specified index.
last_index_ofSearches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the array list that contains the specified number of elements and ends at the specified index.
add_copyAdds and copy a shape to the worksheet.
add_check_boxAdds a checkbox to the worksheet.
add_text_boxAdds a text box to the worksheet.
add_equationAdd an equation object to the worksheet.
add_spinnerAdds a Spinner to the worksheet.
add_scroll_barAdds a ScrollBar to the worksheet.
add_radio_buttonAdds a RadioButton to the worksheet.
add_list_boxAdds a ListBox to the worksheet.
add_combo_boxAdds a ComboBox to the worksheet.
add_group_boxAdds a GroupBox to the worksheet.
add_buttonAdds a Button to the worksheet.
add_labelAdds a Label to the worksheet.
add_label_in_chartAdds a label to the chart.
add_text_box_in_chartAdds a textbox to the chart.
add_text_effect_in_chartInserts a WordArt object to the chart
add_text_effectInserts a WordArt object.
add_word_artAdds preset WordArt since Excel 2007.s
add_rectangleAdds a RectangleShape to the worksheet.
add_ovalAdds a Oval to the worksheet.
add_lineAdds a LineShape to the worksheet.
add_free_floating_shapeAdds a free floating shape to the worksheet.Only applies for line/image shape.
add_arcAdds a ArcShape to the worksheet.
add_shapeAdds a Shape to the worksheet.
add_auto_shapeAdds a AutoShape to the worksheet.
add_auto_shape_in_chartAdds a AutoShape to the chart.
add_active_x_controlCreates an Activex Control.
add_svgAdds svg image.
add_iconsAdds svg image.
add_linked_pictureAdd a linked picture.
add_ole_object_with_linked_imageAdd a linked picture.
add_picture_in_chartAdds a picture to the chart.
add_ole_objectAdds an OleObject.
copy_comments_in_rangeCopy all comments in the range.
copy_in_rangeCopy shapes in the range to destination range.
delete_in_rangeDelete shapes in the range.Comment shapes will not be deleted.
delete_shapeDelete a shape. If the shape is in the group or is a comment shape, it will not be deleted.
groupGroup the shapes.
ungroupUngroups the shape items.
update_selected_valueUpdate the selected value by the value of the linked cell of the shapes.
binary_searchSearches the entire sorted array list for an element using the default comparer and returns the zero-based index of the element.

Example

from aspose.cells import Workbook

# Instantiating a Workbook object
workbook = Workbook()
# get ShapeCollection
shapes = workbook.worksheets[0].shapes
# do your business
# Save the excel file.
workbook.save("result.xlsx")

See Also