Hey gang,
The following code works perfectly in Microsoft 365 on a Windows 8.1 machine...
...and by "works perfectly", I mean, I click a button to run this code, it outputs a crisp PDF of the activesheet, saved with the naming convention required, to the required folder.
Nice.
Until the workbook is opened in Excel 2016 on a Mac, which is when all hell breaks loose:
PS - I know there are issues with folder management in Office 2016 on a Mac. I think I've successfully gotten around that for now. The above inquiry is now to zero in on smoothening the output wrinkles when running this on a Mac.
The following code works perfectly in Microsoft 365 on a Windows 8.1 machine...
VBA Code:
Sub SavetoPDF()
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:= _
Range("FolderPath") & "\" & Range("FileName") & ".pdf" _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=True
End Sub
...and by "works perfectly", I mean, I click a button to run this code, it outputs a crisp PDF of the activesheet, saved with the naming convention required, to the required folder.
Nice.
Until the workbook is opened in Excel 2016 on a Mac, which is when all hell breaks loose:
- it "prints" all sheets, not just the active sheet, even though the code starts with ActiveSheet.ExportAsFixedFormat
- it ignores set print areas, even though IgnorePrintAreas is set to false (which means I want it to pay attention to the print area I set)
- it went to Excel, and not to PDF at all.
PS - I know there are issues with folder management in Office 2016 on a Mac. I think I've successfully gotten around that for now. The above inquiry is now to zero in on smoothening the output wrinkles when running this on a Mac.