add_shape method

add_shape

Adds a Shape to the worksheet.

Returns

A Shape object.

def add_shape(self, type, upper_left_row, top, upper_left_column, left, height, width):
    ...
ParameterTypeDescription
typeMsoDrawingTypeMso drawing type.
upper_left_rowintUpper left row index.
topintRepresents the vertical offset of Shape from its left row, in unit of pixel.
upper_left_columnintUpper left column index.
leftintRepresents the horizontal offset of Shape from its left column, in unit of pixel.
heightintRepresents the height of Shape, in unit of pixel.
widthintRepresents the width of Shape, in unit of pixel.

Remarks

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

Example

from aspose.cells.drawing import MsoDrawingType

# Add a shape of the specified type
shapeByType = shapes.add_shape(MsoDrawingType.CELLS_DRAWING, 1, 0, 1, 0, 100, 50)

See Also