//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(GrapeCity.Documents.Excel.Drawing.AutoShapeType.Parallelogram, 1, 1, 200, 100); shape.Fill.PresetGradient(GrapeCity.Documents.Excel.Drawing.GradientStyle.Vertical, 3, GrapeCity.Documents.Excel.Drawing.PresetGradientType.Silver); shape.Fill.RotateWithObject = false;
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) Dim shape As IShape = worksheet.Shapes.AddShape(AutoShapeType.Parallelogram, 1, 1, 200, 100) shape.Fill.PresetGradient(GradientStyle.Vertical, 3, PresetGradientType.Silver) shape.Fill.RotateWithObject = False ' save to an excel file workbook.Save("ConfigShapeWithGradientFill.xlsx")