xlwings: Shapes: Text Box

Use the AddTextbox method of the Shapes object to create a text box. The calling format and parameters are similar to the AddLabel method. Code:

Continue reading xlwings: Shapes: Text Box

xlwings: Shapes: Labels

Use the `AddLabel` method of the `Shapes` object to create a label. The syntax is:  sht.api.Shapes.AddLabel(Orientation,Left,Top,Width,Height) Where `sht` represents a worksheet object. This method returns a `Shape` object that represents the label. Name Value Description msoTextOrientationDownward 3 Downward msoTextOrientationHorizontal 1 Horizontal msoTextOrientationHorizontalRotatedFarEast 6 Horizontal and rotated for East Asian languages support msoTextOrientationMixed -2 Not supported […]

Continue reading xlwings: Shapes: Labels

xlwings: Shapes: Curves

Use the `AddCurve` method of the Shapes object to create a curve. The method syntax is: sht.api.Shapes.AddCurve(SafeArrayOfPoints) Where `sht` refers to a worksheet object. The parameter `SafeArrayOfPoints` specifies the coordinates of the Bezier curve’s vertices and control points. The number of points should always be 3n + 1, where n is the number of line […]

Continue reading xlwings: Shapes: Curves

xlwings: Shapes: Polylines and Polygons

To draw polylines, polygons, and curves with xlwings, there are some issues. Use another Python package called `comtypes`, which is based on COM, similar to xlwings. First, install the `comtypes` library using the `pip` command in the DOS command window: pip install comtypes Then, enter the following in the Python IDLE window: Code:

Continue reading xlwings: Shapes: Polylines and Polygons

xlwings: Shapes: Rectangles, Rounded Rectangles, Ellipses, and Circles

Use the `AddShape` method of the Shapes object to create rectangles, rounded rectangles, ellipses, and circles. Name Value Description msoShapeRectangle 1 Rectangle msoShapeRoundedRectangle 5 Rounded Rectangle msoShapeOval 9 Ellipse Code:

Continue reading xlwings: Shapes: Rectangles, Rounded Rectangles, Ellipses, and Circles

xlwings: Shapes: Line Segments

Use the AddLine method of the Shapes object to create a line segment. The method syntax is: Where sht refers to a worksheet object. The parameters BeginX, BeginY represent the coordinates of the starting point, and EndX, EndY represent the coordinates of the endpoint. This method returns a Shape object representing the line segment. Code:

Continue reading xlwings: Shapes: Line Segments

xlwings: Shapes: Points

The Shapes object does not provide a specific method to draw points, but it offers several special shapes that can represent points, such as stars, rectangles, circles, diamonds, etc. These AutoShapes can be created using the AddShape method of the Shapes object. The method syntax is: Using the xlwings package API call. sht refers to […]

Continue reading xlwings: Shapes: Points

xlwings: Entering Array Formulas using FormulaArray Property

Data: Code:

Continue reading xlwings: Entering Array Formulas using FormulaArray Property

xlwings: Entering R1C1 Style Formulas using FormulaR1C1 Property

Data: Code:

Continue reading xlwings: Entering R1C1 Style Formulas using FormulaR1C1 Property

xlwings: Entering Regular Formulas

Data: Code:

Continue reading xlwings: Entering Regular Formulas