Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
790 views
in Technique[技术] by (71.8m points)

c# - Microsoft.Office.Interop.Excel - *.csv file opening

I create *.csv file, but when I open it using Microsoft.Office.Interop.Excel, it's formatting is wrong, because of ignoring the delimiter ;.

excelWorkbook = excelApp.Workbooks.Open(workbookPath, 0,
                    false,5,"","", false, Excel.XlPlatform.xlWindows, "", true,
                    false, 0, true, false, false);

Which parameter of Workbooks.Open should I change?

Thank you for your suggestions.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The delimiter argument, which is the 9th one. Change "" to ";". For more info, check msdn


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...