sduttonusa
New Member
- Joined
- Jan 13, 2016
- Messages
- 43
For a couple of years, I've been using a macro in Excel on Windows 10 (running in Parallels on my Mac) that will export each worksheet in my workbook to a separate PDF, saving all of them in a Desktop Folder on my Mac called "ExcelPDFReports" . . . here's the code that works perfectly:
I would really like to get this to work directly on my Mac. When I try, I get an Error In Printing, with all four lines of code highlighted. Any suggestions on how to get this to work on a Mac?
Code:
Sub ExportToPDFsOnZDrive()' PDF Export Macro
' Change C:\Exports\ to your folder path where you need the diles saved
' Save Each Worksheet to a separate PDF file.
Dim ws As Worksheet
For Each ws In Worksheets
ws.Select
nm = ws.Name
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, _
FileName:="Z:\Users\sdutton\Desktop\ExcelPDFReports\" & nm & ".pdf", _
Quality:=xlQualityStandard, IncludeDocProperties:=True, _
IgnorePrintAreas:=False, OpenAfterPublish:=False
Next ws
End Sub
I would really like to get this to work directly on my Mac. When I try, I get an Error In Printing, with all four lines of code highlighted. Any suggestions on how to get this to work on a Mac?