开发者

ExcelDNA / Managed XLL / Excel Interop

开发者 https://www.devze.com 2022-12-12 05:44 出处:网络
I find it quite unbelieavble that the interop API is such a mess A lot of methods have no comment开发者_Go百科s on and seems to have been done very poorly

I find it quite unbelieavble that the interop API is such a mess

A lot of methods have no comment开发者_Go百科s on and seems to have been done very poorly

Has anyone else experienced the same and if so what library do you use to control Exel from C#?


The obvious practical problem with the VSTO/COM Interop technology is the overhead incurred when transitioning between worksheet and managed code. (And if you're trying to talk to Excel without the help of VSTO, stop doing so and save yourself some huge headaches). I thought VSTO did a pretty good job of providing a close analog of the Excel object model in the managed environment - certainly I didn't need to spend much time trying to understand much more about .NET Interop.

For longer-running automation activities the overhead's not so much of a problem, similar concerns to VBA automation apply: reduce calls across the interface as far as possible to get best performance.

For smaller, faster worksheet function-type work (the sort of thing where we might write an XLL, say) that overhead can be a killer. ExcelDNA seems to be a great way into delivering managed code through the XLL model - and the price is right.


SpreadsheetGear for .NET is an Excel compatible spreadsheet component for .NET. It will not enable you to control Excel, but it will give you an Excel compatible spreadsheet engine for ASP.NET / WinForms / etc... that can create, read, modify, view, edit, format, calculate, print and write Excel workbooks and charts from .NET. Since SpreadsheetGear is 100% safe managed code, there is no per-call performance penalty like you get with Excel.

The SpreadsheetGear API is very similar to Excel's API - except for the fact that many APIs are more strongly typed so they tend to be easier to use from C# than Excel's API.

You can see a feature list here, live ASP.NET reporting / charting / dashboard / calculation samples for VB and C# here and download the free trial here.

Disclaimer: I own SpreadsheetGear LLC

0

精彩评论

暂无评论...
验证码 换一张
取 消