C# - 评估Excel的逻辑公式 [英] C# - Evaluate Excel Logical Formulas

查看:215
本文介绍了C# - 评估Excel的逻辑公式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有需要评估Excel的逻辑公式的应用程序,我使用Excel的DLL要做到这一点,但DLL是不是很有效。

.NET框架(C#)有任何类,可以使这项工作?

这是样品

我提供这个

<$p$p><$c$c>=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)))))

和得到这个

  335614
 

感谢

解决方案

是的,同意的的 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:

Hope this helps...

这篇关于C# - 评估Excel的逻辑公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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