I wrote a print to pdf macro that prints this excel template I'm working on. I want it to print 11x17 however when I run the macro bluebeam is recognizing the excel printout sheet size as A1 (594 x 841mm). This may be perhaps because I have the margins so small, however given the following constraints within the code, it is printing exactly how I want it to.
As of now, I have to manually select the paper size when I attempt to print a hard copy from blue beam but the problem I am running into is when I attempt to apply a header and footer in bluebeam to the print out from excel. Other sheets (from either autocad or solidworks) that are printed 11x17 are recognized as 11x17 so when I attempt to apply a header and footer (lets say .35 inches from the bottom and .35 inches from the right) for the sheet's numbering nomenclature, it appears where I want it for the normal 11x17 sheets. However; the excel print outs appear way low and right.
Is there any way to force excel to print to exactly 11x17 so bluebeam does not resize the sheet to A1 (594 x 841 mm)?
Any help is appreciated.
Thank you.
As of now, I have to manually select the paper size when I attempt to print a hard copy from blue beam but the problem I am running into is when I attempt to apply a header and footer in bluebeam to the print out from excel. Other sheets (from either autocad or solidworks) that are printed 11x17 are recognized as 11x17 so when I attempt to apply a header and footer (lets say .35 inches from the bottom and .35 inches from the right) for the sheet's numbering nomenclature, it appears where I want it for the normal 11x17 sheets. However; the excel print outs appear way low and right.
Is there any way to force excel to print to exactly 11x17 so bluebeam does not resize the sheet to A1 (594 x 841 mm)?
Any help is appreciated.
Thank you.
Code:
Sub toPDF()
thepath = CStr(Range("AQ13").Value)
thename = CStr(Range("AQ16").Value)
newrando = Int((50 - 1 + 1) * Rnd + 1)
On Error GoTo Handled
If Len(Dir(thepath & "\printouts", vbDirectory)) = 0 Then
MkDir thepath & "\printouts"
End If
With ActiveSheet.PageSetup
.PaperSize = xlPaperTabloid
.PrintArea = "$A$1:$AO$67"
.LeftMargin = _
Application.InchesToPoints(0.25)
.RightMargin = _
Application.InchesToPoints(0#)
.HeaderMargin = _
Application.InchesToPoints(0.25)
.FooterMargin = _
Application.InchesToPoints(0.2)
.TopMargin = _
Application.InchesToPoints(0.25)
.BottomMargin = _
Application.InchesToPoints(0#)
.PrintQuality = 96
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
If ActiveSheet.PageSetup.Orientation = xlPortrait Then
ActiveSheet.PageSetup.Orientation = xlLandscape
Else
ActiveSheet.PageSetup.Orientation = xlLandscape
End If
FileNam = thepath & "\printouts\" & "Lift Data Sheet" & " - " & thename & ".pdf"
ActiveSheet.ExportAsFixedFormat Filename:=FileNam, Type:=xlTypePDF, OpenAfterPublish:=True
Exit Sub
Handled:
FileNam = thepath & "\printouts\" & "Lift Data Sheet" & " - " & thename & newrando & ".pdf"
ActiveSheet.ExportAsFixedFormat Filename:=FileNam, Type:=xlTypePDF, OpenAfterPublish:=True
End Sub