// 新規ワークブックの作成 var workbook = new GrapeCity.Documents.Excel.Workbook(); //テンプレートを読み込む var fileStream = this.GetResourceStream("xlsx\\Simple invoiceJP.xlsx"); workbook.Open(fileStream); // ワークシートの取得 var worksheet = workbook.ActiveSheet; // セルを指定して文字列を設定 worksheet.Range["A3"].Value = "〒981-9999"; worksheet.Range["A4"].Value = "M県S市広瀬区"; worksheet.Range["A5"].Value = "花京院3-1-4"; worksheet.Range["A6"].Value = "財団法人スピードワゴン協会"; worksheet.Range["A8"].Value = "吉良 富似雄 様"; worksheet.Range["H3"].Value = "11-222"; worksheet.Range["I3"].Value = "葡萄城 太郎"; worksheet.Range["G8"].Value = "ディオドック株式会社"; worksheet.Range["G9"].Value = "〒981-2222"; worksheet.Range["G10"].Value = "M県S市紅葉区杜王町2-6-11"; worksheet.Range["H12"].Value = "022-777-8210"; worksheet.Range["G13"].Value = "むかでや銀行"; worksheet.Range["H13"].Value = "杜王町支店"; worksheet.Range["H14"].Value = "123-456789"; worksheet.Range["A18"].Value = 105; worksheet.Range["E18"].Value = 70; worksheet.Range["F18"].Value = 1200; worksheet.Range["A19"].Value = "モッツァレッラチーズとトマトのサラダ"; worksheet.Range["A20"].Value = 107; worksheet.Range["E20"].Value = 100; worksheet.Range["F20"].Value = 2500; worksheet.Range["A21"].Value = "ナポリ風スパゲティー"; worksheet.Range["A22"].Value = 120; worksheet.Range["E22"].Value = 130; worksheet.Range["F22"].Value = 5000; worksheet.Range["A23"].Value = "小羊背肉のリンゴソースかけ"; worksheet.Range["A24"].Value = 101; worksheet.Range["E24"].Value = 60; worksheet.Range["F24"].Value = 800; worksheet.Range["A25"].Value = "ごま蜜団子"; worksheet.Range["A26"].Value = 116; worksheet.Range["E26"].Value = 80; worksheet.Range["F26"].Value = 1500; worksheet.Range["A27"].Value = "サンジェルマンのサンドイッチバッグ"; // xlsx ファイルに保存 workbook.Save("SimpleInvoiceJP.xlsx");
' 新規ワークブックの作成 Dim workbook As New Workbook 'テンプレートファイルを読み込む Dim fileStream = GetResourceStream("Simple invoiceJP.xlsx") workbook.Open(fileStream) 'ワークシートの取得 Dim worksheet = workbook.ActiveSheet 'データを設定 worksheet.Range("A3").Value = "〒981-9999" worksheet.Range("A4").Value = "M県S市広瀬区" worksheet.Range("A5").Value = "花京院3-1-4" worksheet.Range("A6").Value = "財団法人スピードワゴン協会" worksheet.Range("A8").Value = "吉良 富似雄 様" worksheet.Range("H3").Value = "11-222" worksheet.Range("I3").Value = "葡萄城 太郎" worksheet.Range("G8").Value = "ディオドック株式会社" worksheet.Range("G9").Value = "〒981-2222" worksheet.Range("G10").Value = "M県S市紅葉区杜王町2-6-11" worksheet.Range("H12").Value = "022-777-8210" worksheet.Range("G13").Value = "むかでや銀行" worksheet.Range("H13").Value = "杜王町支店" worksheet.Range("H14").Value = "123-456789" worksheet.Range("A18").Value = 105 worksheet.Range("E18").Value = 70 worksheet.Range("F18").Value = 1200 worksheet.Range("A19").Value = "モッツァレッラチーズとトマトのサラダ" worksheet.Range("A20").Value = 107 worksheet.Range("E20").Value = 100 worksheet.Range("F20").Value = 2500 worksheet.Range("A21").Value = "ナポリ風スパゲティー" worksheet.Range("A22").Value = 120 worksheet.Range("E22").Value = 130 worksheet.Range("F22").Value = 5000 worksheet.Range("A23").Value = "小羊背肉のリンゴソースかけ" worksheet.Range("A24").Value = 101 worksheet.Range("E24").Value = 60 worksheet.Range("F24").Value = 800 worksheet.Range("A25").Value = "ごま蜜団子" worksheet.Range("A26").Value = 116 worksheet.Range("E26").Value = 80 worksheet.Range("F26").Value = 1500 worksheet.Range("A27").Value = "サンジェルマンのサンドイッチバッグ" ' xlsx ファイルに保存 workbook.Save("SimpleInvoiceJP.xlsx")