add_rectangle method

add_rectangle

Adds a RectangleShape to the worksheet.

Returns

A RectangleShape object.

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

Example


#  add a rectangle
rectangleShape = shapes.add_rectangle(2, 0, 2, 0, 130, 130)

See Also