VBA Macro to generate pdf (PC and Mac)

Viewed 67

I have a simple code that runs and allows me to preview a doc via pdf. It works great on a PC but when using a Mac machine I get a

run time error: Error while printing.

enter image description here

Is there a way to alter the this code to accomodate both PC and Mac? (Version 2016/365)

Following code works for PC:

Sub ViewAsPDF()

    Worksheets("Quote (2)").ExportAsFixedFormat _
            Type:=xlTypePDF, _
            Filename:="Quote" & "_" & Worksheets("Quote (2)").Range("C8") & "_" & Format(Now, "MMDDYYYY_HHMM"), _
            Quality:=xlQualityStandard, IncludeDocProperties:=True, _
            IgnorePrintAreas:=False, OpenAfterPublish:=True

End Sub
0 Answers
Related