// 新規ワークブックの作成 var workbook = new GrapeCity.Documents.Excel.Workbook(); var fileStream = this.GetResourceStream("xlsx\\PageSetup Demo.xlsx"); workbook.Open(fileStream); IWorksheet worksheet = workbook.Worksheets[0]; // シートを設定 worksheet.PageSetup.PrintGridlines = true; worksheet.PageSetup.PrintHeadings = true; worksheet.PageSetup.BlackAndWhite = true; worksheet.PageSetup.PrintComments = PrintLocation.InPlace; worksheet.PageSetup.PrintErrors = PrintErrors.Dash; // xlsx ファイルに保存 workbook.Save("ConfigSheetPrintSettings.xlsx");
' 新規ワークブックの作成 Dim workbook As New Workbook Dim fileStream = GetResourceStream("PageSetup Demo.xlsx") workbook.Open(fileStream) Dim worksheet As IWorksheet = workbook.Worksheets(0) ' シートを設定 worksheet.PageSetup.PrintGridlines = True worksheet.PageSetup.PrintHeadings = True worksheet.PageSetup.BlackAndWhite = True worksheet.PageSetup.PrintComments = PrintLocation.InPlace worksheet.PageSetup.PrintErrors = PrintErrors.Dash ' xlsx ファイルに保存 workbook.Save("ConfigSheetPrintSettings.xlsx")