在没有办公室的情况下从 C# 创建 Excel 文件 [英] Create Excel files from C# without office

查看:23
本文介绍了在没有办公室的情况下从 C# 创建 Excel 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个生成 Excel 报告的程序,目前使用 Microsoft.Interop.Excel 参考.我的开发计算机上有 Excel,但最终用户可能安装了 Office,也可能没有安装.如果最终用户计算机上未安装 Office,或者此互操作服务与实际应用程序分开,此工具会失败吗?

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?

推荐答案

除非您在服务器/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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆