I have read Microsoft.Office.Interop.Excel - *.csv file opening but it does not work for me and I don't know why.
First I tried only using the optional parameters I need like this:
Excel.Application xlApp = new Excel.Application();
xlWorkBook = xlApp.Workbooks.Open(path, Delimiter:";");
It opens the csv but separates at the comma.
Then I tried like in the referenced thread above and it does not separate at all.
Excel.Application xlApp = new Excel.Application();
xlWorkBook = xlApp.Workbooks.Open(path,0,false,5, "","",false,Excel.XlPlatform.xlWindows,";",true,false,0,true,false,false);
Here is some sample data I used:
2,138;2,066;2,022;2,076;0,297;;;0,770;1,898;1,864;1,798;1,859;1,715;20,032;8,599;0,039;;;0,336;Iteration: 5 of 500
0,298;0,295;0,298;0,297;0,297;;;0,302;0,296;0,296;0,297;0,297;0,299;0,300;0,296;0,037;;;0,409;Iteration: 6 of 500
0,297;0,299;0,296;0,297;0,311;;;0,295;0,295;0,295;0,295;0,295;0,295;0,306;0,306;0,039;;;0,372;Iteration: 7 of 500
0,299;0,298;0,295;0,297;0,295;;;0,294;0,307;0,295;0,295;0,296;0,297;0,296;0,295;0,040;;;0,368;Iteration: 8 of 500
Has anyone an idea what im doing wrong?
When I open the csv file with a double click (excel standard program to open csv) it formats it as I want. With the semicolon as delimiter. I probably have set it in the properties once.