Macro to export every worksheet to a separate PDF on a Mac

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:

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?
 

Some videos you may like

Excel Facts

Excel Can Read to You
Customize Quick Access Toolbar. From All Commands, add Speak Cells or Speak Cells on Enter to QAT. Select cells. Press Speak Cells.

Watch MrExcel Video

Forum statistics

Threads
1,109,050
Messages
5,526,494
Members
409,704
Latest member
saialkesh

This Week's Hot Topics

Top