// Create a new workbook Workbook workbook = new Workbook(); workbook.open(this.getResourceStream("xlsx/Financial KPIs.xlsx")); IWorksheet worksheet = workbook.getActiveSheet(); IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, worksheet.getRange("G2:J3")); shape.getLine().setVisible(false); shape.getFill().getColor().setRGB(Color.FromArgb(91, 155, 213)); shape.getTextFrame().getTextRange().setText("Treadstone Inc."); shape.getTextFrame().getTextRange().getFont().setSize(20); shape.getTextFrame().getTextRange().getFont().setName("Calibri"); shape.getTextFrame().getTextRange().getFont().getColor().setRGB(Color.GetWhite()); shape.getTextFrame().setHorizontalAnchor(HorizontalAnchor.Center); shape.getTextFrame().setVerticalAnchor(VerticalAnchor.AnchorMiddle); // Save to an excel file workbook.save("AddShapeToRange.xlsx");