C# Excel Interop: Opening and Showing CSV file

后端 未结 2 2003
野的像风
野的像风 2020-12-21 03:58

Hey I\'m writing a wrapper for the excel interop, I want to be able to open a csv file in excel and show it to the user. I\'ve got the basics down, but when i set visible t

相关标签:
2条回答
  • 2020-12-21 04:35

    It is MUCH easier than that if all you want to do is open the file...

     Process proc = new Process();
     proc.StartInfo = new ProcessStartInfo("excel.exe", "output.csv");
     proc.Start();
    
    0 讨论(0)
  • 2020-12-21 04:51

    You will need to use the OpenText method, instead of Open, if you want Excel to parse for delimiters. Details: http://msdn.microsoft.com/en-us/library/bb223513%28v=office.12%29.aspx

    An example in C#: http://msdn.microsoft.com/en-us/library/c9838808.aspx

    0 讨论(0)
提交回复
热议问题