title: VBA Code to Print to PDF in Excel for Mac
body: <p>I am looking to automate printing to PDF in Excel for Mac. I have tried to use the Macro Recorder, but for some reason it doesn't save the save to PDF code. I believe that my issue with the code below is with the Filename:= piece or the Quality:= piece. The name convention may be off since I don't normally do this on a mac, but don't have a PC now. Suggestions would be much appreciated!</p>
  
  <p>See code below:</p>
  
  <pre><code>Sheets("Output").Select
  Range("A1:P57").Select
  ActiveSheet.PageSetup.PrintArea = "$A$1:$P$57"
  With ActiveSheet.PageSetup
      .Orientation = xlLandscape
      .FitToPagesWide = 1
      .FitToPagesTall = 1
  End With
  ActiveWindow.SelectedSheets.ExportAsFixedFormat Type:=xlTypePDF, _
  Filename:="Users/MyName/Desktop/Cash Flow 1.pdf" _
  Quality:=xlQualityMedium, IncludeDocProperties:=False, _
  IgnorePrintAreas:=False, OpenAfterPublish:=True
  </code></pre>