I tried using PathSeparator, and again, with the last '9' it works but gives an error without the '9'. '/Users/' & QTGetUserNameMAC & '/Google Drive/ABC Pte Ltd/Q - Quotations/Q - VAS-Quote-QT190039.pdf' _ ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _ However, if I delete the last '9' in the code, I get the above error. I recorded the macro and used the code generated in my code (as below). , Quality:=xlQualityMinimum, IncludeDocProperties:=True, IgnorePrintAreas _ PdfName = 'Q - ' & Range('F2').Value & ' - ' & Range('A2').Value & ' - ' & Range('B10').TextįullName = '/Users/' & QTGetUserNameMAC & '/Google Drive/ABC Pte Ltd/Q - Quotations/' _ĪctiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=FullName _ IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:= _ĭim pdfName As String, FullName As String
ThisWorkbook.Path & PS & pdfName, Quality:=xlQualityStandard, _ WksSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _ If InStr(1, Application.OperatingSystem, 'Windows') > 0 Then My code, which worked yesterday: 'a) For Windows 'Run-time error '1004': Application-defined or object-defined error'.
My Excel VBA on Mac OS to save as PDF sometimes doesn't work.