I open a csv file and need to save it as xlsx
set objExcel = createObject("Excel.Application")
objExcel.visible = True
set objWb = objExcel.Workbooks.Open("C:\Users\xxx\test.csv")
msgbox "make sure data is ok" 'Here I can see all data was read properly, now I need to save it
objWb.saveas "C:\Users\xxx\test.xlsx"
All saves, but the file is corrupted, I cannot open it. When I change to .xls
then it works but the data is not read correctly. I need xlsx
. How can I save it. So, how to convert .csv
to xlsx
?