excel互操作替代 [英] excel interop alternative

查看:87
本文介绍了excel互操作替代的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经开始使用Microsoft为我的C#应用​​程序之一提供的Excel互操作程序集.一切正常,但似乎缺少强类型输入,说实话,这就像我在编写VBA代码一样.是否有其他替代方法可以与C#中的Excel交互,从而提供更好的OO体验?顺便说一下,我正在使用VS2010和.Net 4.0.

解决方案

在Codeplex上查看EPPlus项目:

http://epplus.codeplex.com/

我最近使用了它,效果很好. (VS2010和.Net4)

EPPlus是一个.net库,它使用Open Office Xml格式(xlsx)读写Excel 2007/2010文件.

漂亮的示例页面: http://epplus.codeplex.com/wikipage?title=ContentSheetExample

I have started using the Excel interop assemblies that are provided by Microsoft for one of my C# applications. Everything is going fine, but there seems to be a lack of strong typing, and honestly it feels like I am writing VBA code. Are there any alternative ways to interact with Excel from C# that would give a better OO experience? I am using VS2010 and .Net 4.0 by the way.

解决方案

Take a look at the EPPlus project over at Codeplex:

http://epplus.codeplex.com/

I recently used this and it worked very well. (VS2010 and .Net4)

EPPlus is a .net library that reads and writes Excel 2007/2010 files using the Open Office Xml format (xlsx).

Nice example page: http://epplus.codeplex.com/wikipage?title=ContentSheetExample

这篇关于excel互操作替代的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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