//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddShape("custom parallelogram", GrapeCity.Documents.Excel.Drawing.AutoShapeType.Parallelogram, 1, 1, 200, 100); //Get shape by name GrapeCity.Documents.Excel.Drawing.IShape parallelogram = worksheet.Shapes["custom parallelogram"]; parallelogram.Fill.Color.RGB = System.Drawing.Color.Red; // Save to an excel file workbook.Save("AddShapeWithCustomName.xlsx");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) Dim shape As IShape = worksheet.Shapes.AddShape("custom parallelogram", AutoShapeType.Parallelogram, 1, 1, 200, 100) 'Get shape by name Dim parallelogram As IShape = worksheet.Shapes("custom parallelogram") parallelogram.Fill.Color.RGB = System.Drawing.Color.Red ' save to an excel file workbook.Save("AddShapeWithCustomName.xlsx")