Reviving an old thread...
How can the solution given here be replicated using VBA (i.e. when saving a .csv file to .xlsx such that numbers stored as string are not converted to scientific notation)?
The code I currently have is:
Sub CSVtoXlsx()
Dim CSVfolder As String
Dim XlsFolder As String
Dim fname As String
Dim wBook As Workbook
inCSVfolder = "c:\temp\output\"
CSVfolder = inCSVfolder
XlsFolder = inCSVfolder
fname = Dir(CSVfolder & "*.csv")
Do While fname <> ""
Set wBook = Workbooks.Open(CSVfolder & fname, Format:=6, Delimiter:=",")
wBook.SaveAs XlsFolder & Replace(fname, ".csv", ""), 51
wBook.Close False
fname = Dir
Loop
End Sub
Bookmarks