I am trying to save an Excel file as CSV to a specific path, it has to have a specific file name and the current date.
If I run this code:
ActiveWorkbook.SaveAs FileName:= _
"/Users/Username/Desktop/UploadFiles/Outbound 15.04.2022_.csv" _
, FileFormat:=xlCSV, CreateBackup:=False
That works , but I need the date to be generated every day anew, so I tried this:
ActiveWorkbook.SaveAs FileName:= _
"/Users/Username/Desktop/UploadFiles/" & "Outbound " & Format(Date, "dd-mm-yyyy") & ".CSV"_
, FileFormat:=xlCSV, CreateBackup:=False
But this returns Compile error:syntax error.
What am I doing wrong here?
Another weird thing is, if I paste the above code, this >>>••••ˇˇˇˇ is appended after the last "false" statement, but I cannot see it in the VBA editor.
Bookmarks