//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape ShapeBegin = worksheet.Shapes.AddShape(GrapeCity.Documents.Excel.Drawing.AutoShapeType.Rectangle, 1, 1, 100, 100); GrapeCity.Documents.Excel.Drawing.IShape ShapeEnd = worksheet.Shapes.AddShape(GrapeCity.Documents.Excel.Drawing.AutoShapeType.Rectangle, 200, 200, 100, 100); GrapeCity.Documents.Excel.Drawing.IShape ConnectorShape = worksheet.Shapes.AddConnector(GrapeCity.Documents.Excel.Drawing.ConnectorType.Straight, 1, 1, 101, 101); //connect shapes by connector shape. ConnectorShape.ConnectorFormat.BeginConnect(ShapeBegin, 3); ConnectorShape.ConnectorFormat.EndConnect(ShapeEnd, 0);
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) Dim ShapeBegin As IShape = worksheet.Shapes.AddShape(AutoShapeType.Rectangle, 1, 1, 100, 100) Dim ShapeEnd As IShape = worksheet.Shapes.AddShape(AutoShapeType.Rectangle, 200, 200, 100, 100) Dim ConnectorShape As IShape = worksheet.Shapes.AddConnector(ConnectorType.Straight, 1, 1, 101, 101) 'connect shapes by connector shape. ConnectorShape.ConnectorFormat.BeginConnect(ShapeBegin, 3) ConnectorShape.ConnectorFormat.EndConnect(ShapeEnd, 0) ' save to an excel file workbook.Save("ConnectShapesByConnector.xlsx")