1

I need a connection from a VISIO document to a WCF service.

I found the following very helpful tutorials:

How do I call WCF client from Excel 2003 VBA?

http://www.codeproject.com/Articles/662009/Streaming-realtime-data-to-Excel

I’ve a lot experience in creating WCF services and clients in C# - but none in VBA/VISIO-Programming. The first link helps to connect a VBA client to a WCF service and call some methods. This works perfect. We’ve a VISIO shape that acts as a button and calls a method of the WCF service and displays the result. We know how to call methods and display values. It is possible to click a button, perform a request to the server and get some results.

The problem is: how to collect results without a user that clicks the button?

VBA doesn’t support a background operation to periodically collect data from the server.

The second article describes how to push data to EXCEL using EXCEL-DNA. I couldn’t find any information whether this will also work with VISIO. EXCEL-DNA will create a *.XLL file that’s a plugin for EXCEL and I think it will not work with VISIO.

Are there any solutions to connect a VISIO client to a WCF/C# service using a ServiceCallback?

Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Sebastian Schumann
  • 3,204
  • 19
  • 37

1 Answers1

1

I'm pretty certain that the WCF duplex bindings are for use in WCF-only scenarios (ie, where both service and client are WCF).

The reason for this is that the way that WCF callbacks work is it causes the client also to host a temporary service endpoint for the service to call back to.

The reason the Excel solution above works is that Excel DNA is a .net wrapper which I bet uses System.ServiceModel to consume the service.

So I agree with T McKeown above when he says that there isn't any way to do this. Sorry this is not the answer you wanted.

tom redfern
  • 30,562
  • 14
  • 91
  • 126
  • Hmpf. I found a way using Application.OnTime (only available for Excel) that enables us to poll the values from the server. But why the hell doesn't microsoft put this method in VBA for VISIO? I hope that there is a way to implement polling for the values. – Sebastian Schumann Jan 20 '14 at 15:01