0

I have this macro written that works as intended on my PC and co-worker's PC but when sent to a client, who is using a Mac (may or may not be the issue)

they are getting a print error 1004 when trying to run the macro and the debugger points them to this line of code (below), thoughts? Unfortunately, I don't have a screenshot of the error.

ActiveSheet.ExportAsFixedFormat xlTypePDF, _
    FileName:=ThisWorkbook.Path & "\Sila Total Rewards Statement_" & SSDest.Range("B9").Value, _
    Quality:=xlQualityStandard

Full code:

Option Explicit

Sub Create_PDFs_Loop_Updated()

Dim FileName As String
Dim Startcell As Long

Let Startcell = 13
'13 indicates the row where employee IDs start (A13 in Sheet1 [Employee Details])

With Application
    .ScreenUpdating = False
    .StatusBar = "Running Macro..."
    .DisplayAlerts = False
End With

Do Until Sheet1.Range("A" & Startcell).Value = ""
    
    With ActiveSheet.PageSetup
        '.Zoom = False
        '.FitToPagesWide = 1
        '.FitToPagesTall = 1
        .BottomMargin = 10
        .TopMargin = 10
        .RightMargin = Application.CentimetersToPoints(1)
        .LeftMargin = Application.CentimetersToPoints(1)
    End With
    Sheet1.Range("A" & Startcell).Copy SSDest.Range("C9:D9")
    ActiveSheet.ExportAsFixedFormat xlTypePDF, FileName:=ThisWorkbook.Path & "\Client Total Rewards Statement_" & SSDest.Range("B9").Value, Quality:=xlQualityStandard
    Startcell = Startcell + 1
        
Loop

With Application
    .ScreenUpdating = True
    .StatusBar = ""
    .DisplayAlerts = True
End With

End Sub```
0m3r
  • 12,286
  • 15
  • 35
  • 71
TroyG
  • 11
  • 2

0 Answers0