Using WCF with Excel 2003?

Does anyone know or can find sample code showing how to invoke a WCF service using Excel 2003?

+4
source share
5 answers

This article discusses accessing Web Services in Excel using Visual Studio tools for the Microsoft Office System , and the information should be applied similarly to the WCF service.

+2
source

I do not have the perfect winner for you, it will probably be difficult. For Office 2007, it was much better to evolve. But considering this, you should check out Visual Studio Tools for Office . Here are some examples of using VSTO with Excel 2003 . Here's an article on how to call WCF from an Office 2007 application. You should be able to accept this with some success. GL. :)

+2
source

If you want to call WCF web services from Excel2003, and you do not want to use VSTO, you need a COM-compatible parameter (No.Net).

Although this is Tooooootally deprecated (and uncool), you can achieve this using basicHttpBinding on the server, and the Soap Toolkit

If you do not want this, you can make calls using the .NET assembly and use COM Interop to call from Excel.

+2
source

Perhaps you should take a look at using the Moniker WCF service, which allows you to call the WCF service from VBA without installing any elements on an Excel client machine other than the .NET Framework.

Dim addr As String addr = "service:mexAddress=""net.tcp://localhost:7891/Test/WcfService1/Service1/Mex""," addr = addr + "address=""net.tcp://localhost:7891/Test/WcfService1/Service1/""," addr = addr + "contract=""IService1"", contractNamespace=""http://tempuri.org/""," addr = addr + "binding=""NetTcpBinding_IService1"",bindingNamespace=""http://tempuri.org/""" Dim service1 As Object Set service1 = GetObject(addr) MsgBox service1.GetData(12) 

I wrote out a complete step-by-step example .

/ Damian

+1
source

REST services also work great with Excel.
If you use "WebHttpBinding", you can import data into Excel using File → Open or via Import External data → Xml.
Not quite perfect since 2003 (much better since 2007).

0
source

All Articles