从没有办公室的C#创建Excel文件 [英] Create Excel files from C# without office
问题描述
可能重复:
从C#创建Excel(.XLS和.XLSX)文件
Possible Duplicate:
Create Excel (.XLS and .XLSX) file from C#
我正在编写一个生成excel报告的程序,目前使用的是Microsoft.Interop.Excel引用。我的开发计算机上有Excel,但最终用户可能安装了或不可能安装Office。如果Office没有安装在最终用户的计算机上,或者这个interop服务与实际的应用程序是否分开,这个工具是否会失败?
I am writing a program that generates excel reports, currently using the Microsoft.Interop.Excel reference. My dev computer has Excel on it, but the end user may or may not have Office installed. Will this tool fail if Office isn't installed on the end users computer, or is this interop service separate from the actual application?
推荐答案
p>除非您在服务器/ PC上安装了Excel或使用外部工具(可以不使用Excel Interop,请参阅从C#创建Excel(.XLS和.XLSX)文件),它将失败。 使用互操作需要安装Excel。
Unless you have Excel installed on the Server/PC or use an external tool (which is possible without using Excel Interop, see Create Excel (.XLS and .XLSX) file from C#), it will fail. Using the interop requires Excel to be installed.
这篇关于从没有办公室的C#创建Excel文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!