views:

20

answers:

1

So, let's say that I have a VBA application inside of whatever Office Application. I have created a command-line VB.net program to do all of the fun web-services stuff.

Okay, the VBA application calls Shell() to run the command line program. Now, what is the best way to get information (a tracking number for a package) from the VB.net program back into the VBA program?

My thoughts on the issue so far include:

  • Writing the number with Console.Write and then somehow extracting it in VBA
  • Or, using some kind of external interface (like a database or file system) to number the data and then get it out in VBA.

Any thoughts on this?

+2  A: 

Why not call the Web service directly from VBA?

Check the samples in MSDN on how this can be done:

Calling XML Web Services from Office VBA Using the Web Service References Tool

Other options that you have would be:

  • Make your VB assembly COM-visible so that you talk to the VB code directly without having to launch a separate process
  • Write all relevant data to an intermediate file and read that from VBA
0xA3
Thanks for the answer. Trust me, I started out attempting to do all the WebServices stuff in VBA but, the reference tool didn't seem as good as the one for Vb.net (It missed a lot of interfaces..) But, thank you for the suggestions. You'll get the green check-mark as soon as I can mark it. ;)
huntaub