Hi everyone,
I came across a problem with the task currently at hand:
I need to save a file as .csv with a semicolon as separator. My Windows regional settings also have a semicolon as list separator. When I manually save the file as csv (or even manually save a macro generated .csv before closing it) it works totally fine, I get a nice file that has a semicolon as separator and looks like a normal excel table.
Nevertheless, when I save and close the file with VBA code, and then reopen it I get a very curious picture: the data is separated by commas.
Below is the piece of code that I use regarding the workbook I need to save as .csv. Any tips on how to fix this?
Thanks a lot for your help!
I came across a problem with the task currently at hand:
I need to save a file as .csv with a semicolon as separator. My Windows regional settings also have a semicolon as list separator. When I manually save the file as csv (or even manually save a macro generated .csv before closing it) it works totally fine, I get a nice file that has a semicolon as separator and looks like a normal excel table.
Nevertheless, when I save and close the file with VBA code, and then reopen it I get a very curious picture: the data is separated by commas.
Below is the piece of code that I use regarding the workbook I need to save as .csv. Any tips on how to fix this?
Thanks a lot for your help!
Code:
Set csv = Workbooks.Add(xlWBATWorksheet)
csv.SaveAs Filename:=path & "\template.csv", FileFormat:=xlCSV
'some code to fill the .csv file with data
csv.Save
csv.Close