View Single Post
 
Old 07-12-2018, 01:48 PM
darbykate darbykate is offline Windows 10 Office 2016
Novice
 
Join Date: Jul 2018
Posts: 3
darbykate is on a distinguished road
Default problem with excel to pdf macro

Good Afternoon!
I'm having some issues with a macro that I built to select certain sheets of my excel file to export as a PDF. It's saving with the correct name and in the correct place, but the sheets only show the footer and maybe one line.

Below is what i have.
Sub Print_To_PDF()
' Print_to_PDF Macro

' Set Path to Save
fPath = "C:\Users\dkdougl1\Documents\"
'Set File Name
fName = Sheets("Notes and Warnings").Range("A33")

'Select sheets to Print to PDF
Sheets(Array("Calibration Sheet", "Weighing Dry", "Weighing Wet", "Final Weigh", "Base Mix Sheet", "Final Mix Sheet", "Weigh Up Operations", "Base Start Up Operations", "Base Mixing Operations", _
"Base Mill Operations", "Final Start Up", "Final Mix Operations", _
"Final Mill Operations")).Select

'Print Selected Sheets to PDF
Selection.ExportAsFixedFormat Type:=x1TypePDF, FileName:=fPath & fName, OpenAfterPublish:=True

End Sub


Thanks!
Reply With Quote