Hi Everyone
I have been using the below code (kindly suggested by someone on this forum) at the end of my vba to save the file as a csv with a custom filename. It doesn't seem to be actually changing the format of the file though.
The file extension shows csv however if I try to open the created file I get an error saying 'the file format and extension of [file name] do not match.
Any suggestions on what needs to be changed?
I have been using the below code (kindly suggested by someone on this forum) at the end of my vba to save the file as a csv with a custom filename. It doesn't seem to be actually changing the format of the file though.
The file extension shows csv however if I try to open the created file I get an error saying 'the file format and extension of [file name] do not match.
Code:
TMS845Sub savedi()
myfilename = "INV_TRC_" & Range("c1") & "_" & Format(Now(), "DDMMYYYYHHMMSS")
Filename = Application.GetSaveAsFilename(InitialFileName:=myfilename, fileFilter:="csv Files (*.csv), *.csv")
ActiveWorkbook.SaveAs Filename:=Filename
End Sub
Any suggestions on what needs to be changed?