开发者

What is the best way of accessing a WCF service from Excel?

开发者 https://www.devze.com 2023-02-12 02:14 出处:网络
I would like to access a WCF service through VBA functions/macros in Excel (2007 or 2010). It seems there are a number of possibil开发者_高级运维ities, each with its own particular shortcomings. ...

I would like to access a WCF service through VBA functions/macros in Excel (2007 or 2010).

It seems there are a number of possibil开发者_高级运维ities, each with its own particular shortcomings. ...

  • Microsoft SOAP Toolkit
  • WCF Service Moniker
  • COM Interop
  • VSTO
  • Excel-DNA

Can anyone advise on the best way of doing this?


I don't think there is a clear-cut answer to your question; it depends a bit on what you want to do with the data returned from the service, how you intend to deploy your solution, and how much is done with VBA, as opposed to .NET.
My gut feeling is that VSTO is probably right, because it gives you a full-fledged .NET project, which will likely be the most convenient to handle the WCF services. Assuming that what you are trying to do is retrieve data and give your user choices as to what to pull and how to display it, you can then build a user interface for it (maybe in a task pane), and write the results to Excel, while writing code in Visual Studio.
However, you mentioned VBA, and I am not quite sure how much you want to use it. I found ExcelDNA to be easier to use if what you want to do is create a VBA user-defined function which calls a .NET dll. If VBA is what you want to focus on, this may be the way to go.
Hope this helps!

0

精彩评论

暂无评论...
验证码 换一张
取 消