C#应用程序和Excel公式 [英] C# application and Excel formulas
问题描述
大家好
我有一个包含复杂公式系统的Excel文件(7000个公式!)在某些单元格上输入N个变量,产生结果。我必须确保C#DLL可以拥有这个计算系统并因此输入自己,相同的输出
使用相同的公式。请记住,Excel例程每6-12个月更改一次。
我会说我有两种选择:
1.将所有公式导入C#语言到DLL中(记住:7000个公式!)
2.将excel文件附加到DLL(例如,EPPlus库)。但是,这会在Excel文件和.NET DLL库之间产生依赖关系。
3.其他替代方案?
您建议我什么?
谢谢
I have an Excel file that contains a complex formula system (7000 formulas!) That, given an input of N variables on certain cells, produce a result. I have to make sure that a C # DLL can have this computing system and therefore input itself, same output
with the same formulas. Keep in mind that Excel routines change every 6-12 months.
I would say that I have two alternatives:
1. Import all formulas into C # language into the DLL (remember: 7000 formulas!)
2. Attach the excel file to the DLL (for example, the EPPlus library). This however creates a dependency between an Excel file and a .NET DLL library.
3. Other alternatives?
What do you suggest me?
Thank you
Matteo
推荐答案
您好,
您将无法简单地将公式导入C#代码,因为我相信您已经知道如果不以专业方式完成依赖第三方库在Microsoft Excel自动化方面很脆弱,因为可以引入新版本并导致问题。
You will not be able to simply import your formulas into C# code as I believe you already know without creating a dependency to a third party library if being done in a professional manner as relying on Microsoft Excel automation is brittle in the sense that a new version can be introduced and cause problems.
我会建议(认为最好的想法是合并第三方库是没问题的)查看
Aspose Cells 。 Aspose提供大多数公司试用期以测试其功能。 Aspose不依赖于安装特定版本的Excel,即使安装了Excel也无需工作。
I would recommend (thinking that the best idea is to incorporate a third party library is okay) looking at Aspose Cells. Aspose offers like most companies a trial period to test out their functions. Aspose is not dependent on having a specific version of Excel installed and will work without Excel even installed.
这篇关于C#应用程序和Excel公式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!