//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); var fileStream = GetResourceStream("xlsx\\ConfigIsAutoFirstPageNumber.xlsx"); workbook.Open(fileStream); IWorksheet worksheet = workbook.Worksheets[0]; worksheet.PageSetup.CenterFooter = "&P"; //Set auto page number, original first page number is 3. worksheet.PageSetup.IsAutoFirstPageNumber = true; // Save to an excel file workbook.Save("SetIsAutoFirstPageNumber.xlsx");
' Create a new Workbook Dim workbook As New Workbook Dim fileStream = GetResourceStream("ConfigIsAutoFirstPageNumber.xlsx") workbook.Open(fileStream) Dim worksheet As IWorksheet = workbook.Worksheets(0) worksheet.PageSetup.CenterFooter = "&P" 'Set auto page number, original first page number is 3. worksheet.PageSetup.IsAutoFirstPageNumber = True ' save to an excel file workbook.Save("SetIsAutoFirstPageNumber.xlsx")