简体   繁体   English

如何评估 c# 控制台应用程序中的 Excel 功能?

[英]How can I evaluate Excel functions in c# Console App?

I have to create a function in C# allowing to calculate Excel formulas entered in a string:我必须在 C# 中创建一个 function 允许计算 Excel 输入字符串的公式:

for example:例如:

ROUND(COUNTIF(['YES', 'NO'],'YES')*(100/4),1) ROUND(COUNTIF(['YES', 'NO'],'YES')*(100/4),1)

I absolutely have to use a free library, but I can't find anything to do so in C#.我绝对必须使用免费库,但在 C# 中找不到任何可以这样做的东西。

Has anyone come across this problem before?有没有人遇到过这个问题?

Thanks for your help谢谢你的帮助

Explications of the app context:应用上下文的解释:

This function receives as a parameter a string which has already been generated on another application over which I do not have control.这个 function 接收一个字符串作为参数,该字符串已经在另一个我无法控制的应用程序上生成。

the need is to find a way evaluate this kind of string containing some Excel functions.需要找到一种方法来评估这种包含一些 Excel 函数的字符串。

EPPlus v4 is LGPL. EPPlus v4是 LGPL。 It can create Excel files but not execute them AFAIK.它可以创建 Excel 文件但不能执行它们 AFAIK。 But you could automate Excel afterwards .但是你可以在之后自动化 Excel

As @DS_London said: it is a weird use case, are you sure you got it right?正如@DS_London所说:这是一个奇怪的用例,你确定你做对了吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM