有没有办法像使用 C# 的 MS Office Excel 一样创建/读取 LibreOffice 电子表格?
在创建 Excel 文件的程序中,我想知道是否可以为没有 MS Office 的用户提供仅安装 LibreOffice 来创建 .xls 文件的机会。我应该使用什么来代替“using Excel = Microsoft.office.interlope.excel;”和其余的命令?天啊!
In a program that creates an excel file, i wonder if i could give the chance to the users that don't have MS Office to create an .xls file with only LibreOffice installed. What should i use instead of "using Excel = Microsoft.office.interlope.excel;" and the rest of the commands ? TnX!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
LibreOffice 使用 ODF(开放文档格式)。 ODF 并不是一种难以掌握的格式,因为它基本上只是压缩成一个文件(称为 ODF 文件)的 XML 文件的集合。您可以阅读此处了解如何读取和保存 ODF 文件。另外,您可以在此处查看 C# 的真实示例
LibreOffice uses the ODF (Open Document Format). ODF is not a hard format to grasp because all it basically is is a collection of XML files that are zipped into one file, called an ODF file. You can read here on how to read and save ODF files. Also, you can check here for a real example in C#
如果您安装了 LibreOffice,请查找 cli_basetypes.dll、cli_cppuhelper.dll、cli_oootypes.dll、cli_uno.dll、cli_ure.dll、cli_uretypes.dll,然后添加对您的项目的引用,它一定适合您,我还安装了“Microsoft Office Compatibility” Pack for Word、Excel 和 PowerPoint 文件格式”和“Microsoft Access Database Engine 2010 Redistributable”(获取ACE.OLEDB.12.O 连接,无需完成 Office 安装)。这是 VB 示例的一部分,其中我连接到 oledb 以创建一些查询。
If you had installed LibreOffice look for cli_basetypes.dll, cli_cppuhelper.dll, cli_oootypes.dll, cli_uno.dll, cli_ure.dll, cli_uretypes.dll then add references to your project, it must work for you, i also installed "Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint File Formats" and "Microsoft Access Database Engine 2010 Redistributable" (to get ACE.OLEDB.12.O connection without complete Office installation). This is a part of VB Sample in which i got connection to oledb to create some queries.