I have a excel macro working on Excel on my PC, but now I tried to get it working on my new Mac with Excel 2016. Basically it saves the actual File based on a Field in the Workbook and the actual date. Then it saves the same file as pdf. When I exceute the script I get a runtime error that the file cannot be saved, pointig on the line where "SaveAs"... is located. I think this has to do with the variables in the filename, because a fixed filename is woking...
Sub save_pdf()
Dim nr, jahr, jahreszahl, stdPfad, Dateiname
jahreszahl = Year(Now)
stdPfad = "Users/**myname**/Dropbox/Buchhaltung & Steuer/Customer/Zeiterfassung/" & jahreszahl & "/" & Format(Now, "mmmm") & "/"
Dateiname = stdPfad & "Zeiterfassung " & " " & Format(Now, "mmmm ") & [Projekt] & " " & Format(Now, "ddmmyyyy")
ActiveWorkbook.SaveAs Filename:=Dateiname
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=Dateiname _
& ".pdf", Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
End Sub
Can someone push me in the right direction?