Your assistance is needed regarding how to include a header and page numbers into a created PDF file.
The goal is to include MS Access VBA statements within the creation, as well. The code below creates a PDF file by using a Master Workbook with 53 worksheets. I have been able to manually update the Master spreadsheet by adding the header and footer; however, the process should ultimately be automated.
Perhaps, adding a function to update the worksheet formats before creation would be an option? For example, make every header for each worksheet the same name as the worksheet tab and all footers has a Page Number.
Private Sub Prepare_PDF_Click()
Dim MyFullName As String
Dim xlAppFTP As Object, xlWb As Object, xlWs As Object
Set xlAppFTP = CreateObject("Excel.Applic
Set xlWb = xlAppFTP.Workbooks.Open(
MyFullName = "H:\PDF\MonthlyReport.pdf"
xlWb.ExportAsFixedFormat Type:=0, FileName:=MyFullName, _
, IgnorePrintAreas:=False, OpenAfterPublish:=False
Set xlWs = Nothing
Set xlAppFTP = Nothing
Set xlApp = Nothing
MsgBox "The PDF file was created"