保存Excel文件在C#code csv文件 [英] Save an excel file to a csv file in C# code
本文介绍了保存Excel文件在C#code csv文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想打开一个Excel文件并将其保存为csv文件。谷歌搜索没有幸运。 我需要升C code做到这一点。
I want to open an excel file and save it as a csv file. Google search no lucky. I need C sharp code to do it.
感谢您不错的帮助。
推荐答案
如果你愿意使用Excel互操作:
If you are willing to use Excel Interop:
Excel.Application app = new Excel.Application();
Excel.Workbook wb = app.Workbooks.Open(@"c:\temp\testtable.xlsx");
wb.SaveAs(@"C:\Temp\output.csv", Excel.XlFileFormat.xlCSVWindows);
wb.Close(false);
app.Quit();
Console.WriteLine("Done!");
这篇关于保存Excel文件在C#code csv文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文