Youseepooo
New Member
- Joined
- Feb 5, 2019
- Messages
- 37
Hello
I am trying to print and have the vba code adjust margins so i don't have to every time. The issue im running into is that it wont print it to a 11x17 pdf size and it wont fix the margins for me. It wont print to scale.
Anyways it keeps saying "Document not saved" AND when i debug it goes to the Range line LN:6
What is the issue?
I am trying to print and have the vba code adjust margins so i don't have to every time. The issue im running into is that it wont print it to a 11x17 pdf size and it wont fix the margins for me. It wont print to scale.
Anyways it keeps saying "Document not saved" AND when i debug it goes to the Range line LN:6
What is the issue?
Code:
Sub pint()Range("A5:x171").ExportAsFixedFormat Type:=xlTypePDF, Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=True
ActiveSheet.PageSetup.PrintArea = myRange
With ActiveSheet.PageSetup
.LeftMargin = Application.InchesToPoints(0.5)
.RightMargin = Application.InchesToPoints(0.5)
.TopMargin = Application.InchesToPoints(0.5)
.BottomMargin = Application.InchesToPoints(0.5)
.HeaderMargin = Application.InchesToPoints(0.2)
.FooterMargin = Application.InchesToPoints(0.1)
.PaperSize = xlPaper11x17
.Orientation = xlLandscape
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
End Sub