I have some issues with my super simple "create pdf" macro. It seems to work most of the time, but sometimes it doesn't. Then I change something, it works once/twice, then it stops working again, and then when I change it back to the original oddly it starts working again for some time. I have no idea what to do and I am desperate for help. Please save my week!




Sub save_pdf()
'
' save_pdf Macro
'

'
pdfName = ThisWorkbook.Sheets("360").Range("E7").Value
ActiveWorkbook.SaveAs FileName:= _
"/Users/erpokorp/Documents/folder/360°/" & pdfName & ".xlsm", _
FileFormat:=xlOpenXMLWorkbookMacroEnabled, CreateBackup:=False
ChDir "/Users/erpokorp/Documents/folder/360°/"
Sheets("360").ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
"/Users/erpokorp/Documents/folder/360°/" & pdfName & ".pdf", Quality:= _
xlQualityMinimum, IncludeDocProperties:=False, IgnorePrintAreas:=True, _
OpenAfterPublish:=False
End Sub