My Excel VBA on Mac OS to save as PDF sometimes doesn't work.

It will give

> 
> "Error while printing"
> 
> 
> 

then

> 
> "Run-time error '1004': Application-defined or object-defined error".
> 
> 
> 

My code, which worked yesterday:

```
'a) For Windows

Dim wksSheet As Worksheet, PS As String

PS = Application.PathSeparator

If InStr(1, Application.OperatingSystem, "Windows") > 0 Then
    Set wksSheet = ActiveSheet
    wksSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
      ThisWorkbook.Path & PS & pdfName, Quality:=xlQualityStandard, _
      IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _
      False
    'Exit Sub

Else

'b) For MAC

    Dim pdfName As String, FullName As String

    pdfName = "Q - " & Range("F2").Value & " - " & Range("A2").Value & " - " & Range("B10").Text
    FullName = "/Users/" & QTGetUserNameMAC & "/Google Drive/ABC Pte Ltd/Q - Quotations/" _
      & pdfName & ".pdf"

    ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=FullName _
      , Quality:=xlQualityMinimum, IncludeDocProperties:=True, IgnorePrintAreas _
      :=False, OpenAfterPublish:=False

End If

```

I recorded the macro and used the code generated in my code (as below). It works. However, if I delete the last '9' in the code, I get the above error.

```
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
  "/Users/" & QTGetUserNameMAC & "/Google Drive/ABC Pte Ltd/Q - Quotations/Q - VAS-Quote-QT190039.pdf" _
  , Quality:=xlQualityMinimum, IncludeDocProperties:=True, IgnorePrintAreas _
  :=False, OpenAfterPublish:=False

```

I tried using PathSeparator, and again, with the last '9' it works but gives an error without the '9'.