// 新規ワークブックの作成 var workbook = new GrapeCity.Documents.Excel.Workbook(); var fileStream = this.GetResourceStream("xlsx\\PageSetup Demo.xlsx"); workbook.Open(fileStream); IWorksheet worksheet = workbook.Worksheets[0]; // A4版用紙を設定 worksheet.PageSetup.PaperSize = PaperSize.A4; // xlsx ファイルに保存 workbook.Save("ConfigPaperSize.xlsx");
' 新規ワークブックの作成 Dim workbook As New Workbook Dim fileStream = GetResourceStream("PageSetup Demo.xlsx") workbook.Open(fileStream) Dim worksheet As IWorksheet = workbook.Worksheets(0) ' A4版用紙を設定 worksheet.PageSetup.PaperSize = PaperSize.A4 ' xlsx ファイルに保存 workbook.Save("ConfigPaperSize.xlsx")