C# - 评估Excel逻辑公式 [英] C# - Evaluate Excel Logical Formulas
本文介绍了C# - 评估Excel逻辑公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个需要评估Excel逻辑公式的应用程序,我使用Excel DLL来执行此操作,但是DLL不是很有效。
.NET Framework (C#)有任何可以做这份工作的课程?
一个样本
我提供这个
= IF(AND(10> = - 5; 10 <0);( - 3,8 * 10 + 335); IF AND(10 -10 = 0; 10小于5);(1,4 * 10 + 335); IF(AND(10 -10 = 5; 10< 14,4);( - 1,2766 * 10 + 348,38) ; IF(AND(10 -10 = 14,4; 10< 25);( - 1,5094 * 10 + 351,74); IF(AND(10 -10 = 25; 10< = 45);( - 1,4 * 10 + 349); 0))))))
并得到这个
335,614
谢谢
解决方案
是的,同意, Excel.Application.Evaluate 方法可能很慢。我通常认为,没有Excel对象模式来评估Excel公式的最佳来源是:
其他相关文章:
希望这有帮助...
I have an Application that need to evaluate Excel Logical Formulas and I use Excel DLL to do this, but DLL isn't it very efficient.
.NET Framework (C#) has any Class that can make this Job?
An sample
I Provide this
=IF(AND(10>=-5;10<0);(-3,8*10+335);IF(AND(10>=0;10<5);(1,4*10+335);IF(AND(10>=5;10<14,4);(-1,2766*10+348,38);IF(AND(10>=14,4;10<25);(-1,5094*10+351,74);IF(AND(10>=25;10<=45);(-1,4*10+349);0)))))
And get this
335,614
Thanks
解决方案
Yes, agreed, the Excel.Application.Evaluate method can be slow. It usually suits my needs, but it's not lightening fast.
I think the best source for evaluating Excel formulas without the Excel object mode is:
Some other related articles:
- Invesitgation into Excel Syntax and a Formula Grammar
- Runtime code generation to speed up spreadsheet computations
Hope this helps...
这篇关于C# - 评估Excel逻辑公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文