将.net方法作为Excel函数? [英] Exposing .net methods as Excel functions?

查看:118
本文介绍了将.net方法作为Excel函数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一套坐在.Net DLL中的计算方法。我想使这些方法可用于Excel(2003+)用户,以便他们可以在他们的电子表格中使用它们。



例如,我的.net方法:

  public double CalculateSomethingReallyComplex(double a,double b){...} 

我想让他们通过在随机单元格中键入公式来调用此方法:

  = CalculateSomethingReallyComplex(A1,B1)

什么是最好的方式可以使用Visual Studio Tools for Office(VSTO):



http:/ /blogs.msdn.com/pstubbs/archive/2004/12/31/344964.aspx



或者你可以使用COM:



http:/ /blogs.msdn.com/eric_carter/archive/2004/12/01/273127.aspx



我不知道VSTO方法是否会工作在旧版本的Excel中,但COM方法应该可以正常工作。


I have a set of calculation methods sitting in a .Net DLL. I would like to make those methods available to Excel (2003+) users so they can use them in their spreadsheets.

For example, my .net method:

public double CalculateSomethingReallyComplex(double a, double b) {...}

I would like enable them to call this method just by typing a formula in a random cell:

=CalculateSomethingReallyComplex(A1, B1)

What would be the best way to accomplish this?

解决方案

There are two methods - you can used Visual Studio Tools for Office (VSTO):

http://blogs.msdn.com/pstubbs/archive/2004/12/31/344964.aspx

or you can use COM:

http://blogs.msdn.com/eric_carter/archive/2004/12/01/273127.aspx

I'm not sure if the VSTO method would work in older versions of Excel, but the COM method should work fine.

这篇关于将.net方法作为Excel函数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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