// 新規ワークブックの作成 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); // 名前によって図形を取得 GrapeCity.Documents.Excel.Drawing.IShape parallelogram = worksheet.Shapes["custom parallelogram"]; parallelogram.Fill.Color.RGB = System.Drawing.Color.Red; // xlsx ファイルに保存 workbook.Save("AddShapeWithCustomName.xlsx");
' 新規ワークブックの作成 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) ' 名前によって図形を取得 Dim parallelogram As IShape = worksheet.Shapes("custom parallelogram") parallelogram.Fill.Color.RGB = System.Drawing.Color.Red ' xlsx ファイルに保存 workbook.Save("AddShapeWithCustomName.xlsx")