cool1_boy1
New Member
- Joined
- Mar 19, 2013
- Messages
- 21
I have a worksheet that I want to convert to PDF using ExportAsFixedFormat.
I have a subroutine, PrintSheet, that formats the sheet's margins, header/footer, etc.
If I print preview the sheet, everything looks great, but when I use ExportAsFixedFormat, the output PDF cuts off many rows and columns. Any suggestions?
I have a subroutine, PrintSheet, that formats the sheet's margins, header/footer, etc.
If I print preview the sheet, everything looks great, but when I use ExportAsFixedFormat, the output PDF cuts off many rows and columns. Any suggestions?
Code:
Sub TestPrint()
With ActiveWorkbook
FileNameWithoutExtension = Left(.Name, (InStrRev(.Name, ".", -1, vbTextCompare) - 1))
CurrentFolder = .Path & "\"
End With
With ActiveSheet
Call PrintSheet(.Name)
.Select
End With
With Selection
.ExportAsFixedFormat Type:=xlTypePDF, Filename:=CurrentFolder & FileNameWithoutExtension & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=True
End With
End Sub