What I am trying:
- copy all data from a closed CSV (works)
- paste it separated
initial position:
- CSV data is delimited by semicolon ;
- the code below copies everything, but only separates by comma , (pretty bad for europeans -.-')
Sub GetDatafromCSV()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim FileName As String
Set cn = New ADODB.Connection
cn.ConnectionString = _
"Provider=Microsoft.ACE.OLEDB.16.0;" & _
"Data Source=" & GetLocalPath(ThisWorkbook.Path) & "\;" & _
"Extended Properties='text;HDR=YES;FMT=Delimited(';')'"
cn.Open
Set rs = New ADODB.Recordset
rs.ActiveConnection = cn
rs.Source = "SELECT * FROM [Test.csv]"
rs.Open
Tabelle2.Range("A21").CopyFromRecordset rs
rs.Close
cn.Close
End Sub
I have been googling for a few hours now but at this point i just get the same search results over and over again. What have i tried:
- schema.ini file didnt work, its also not practical at all having to create a new ini file for every new CSV
- MS Text Driver not working because I am using 64 bit?!
- Jet 4.0 not working because i am using 64 bit?!
- I tried "Extended Properties='text;HDR=YES;FMT=Delimited**(;)**'" -> error
- trying to find the Delimiter "," in the registry and change to ";" but couldnt find it
My VBA knowledge is very little as you can read, i am basically just copying all the code together
Edit:
Thanks for the suggestion (CSV with comma or semicolon?) but my system operator already is ";" and it doesnt change a thing sadly.