Hello , After I use the Macro titled SaveRangeAsPDF the macro titled Printestimate will not Printout to the printer .When I run the subs in this order the PrintEstimate sub will quickly show a box that says processing but the printer icon does not show 1 and nothing prints.
If I use the PrintEstimate sub before the SaveRangeAsPDF I can use it as many times as I want with no issue and it works perfectly.
Ideally I would like to combine these two subs into one and be able to run it as many times as I want. This is due to me changing data and then wanting to save pdf and printout .
Any help would be greatly appreciated.
Sub SaveRangeAsPDF()
Dim saveLocation As String
Dim rng As Range
With ActiveSheet.PageSetup
.Orientation = xlPortrait
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
'This is the file destination and range
saveLocation = "/Users/boauman/Desktop/Bobs Personal/Estimate pdf/"
Set rng = Range("$A$108:$F$160")
'Save a range as PDF
rng.ExportAsFixedFormat Type:=xlTypePDF, _
FileName:=saveLocation & Range("B1").Value _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
ActiveSheet.PageSetup.Zoom = 87
End Sub
Sub Printestimate()
With ActiveSheet.PageSetup
.Orientation = xlPortrait
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Application.Goto Reference:="ESTIMATE"
ActiveSheet.PageSetup.PrintArea = "$A$108:$F$160"
Range("A108:F160").Select
ActiveSheet.PageSetup.PrintArea = "$A$108:$F$160"
Selection.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.Zoom = 87
End Sub
If I use the PrintEstimate sub before the SaveRangeAsPDF I can use it as many times as I want with no issue and it works perfectly.
Ideally I would like to combine these two subs into one and be able to run it as many times as I want. This is due to me changing data and then wanting to save pdf and printout .
Any help would be greatly appreciated.
Sub SaveRangeAsPDF()
Dim saveLocation As String
Dim rng As Range
With ActiveSheet.PageSetup
.Orientation = xlPortrait
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
'This is the file destination and range
saveLocation = "/Users/boauman/Desktop/Bobs Personal/Estimate pdf/"
Set rng = Range("$A$108:$F$160")
'Save a range as PDF
rng.ExportAsFixedFormat Type:=xlTypePDF, _
FileName:=saveLocation & Range("B1").Value _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
ActiveSheet.PageSetup.Zoom = 87
End Sub
Sub Printestimate()
With ActiveSheet.PageSetup
.Orientation = xlPortrait
.Zoom = False
.FitToPagesWide = 1
.FitToPagesTall = 1
End With
Application.Goto Reference:="ESTIMATE"
ActiveSheet.PageSetup.PrintArea = "$A$108:$F$160"
Range("A108:F160").Select
ActiveSheet.PageSetup.PrintArea = "$A$108:$F$160"
Selection.PrintOut Copies:=1, Collate:=True
ActiveSheet.PageSetup.Zoom = 87
End Sub