View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
moi moi is offline
external usenet poster
 
Posts: 27
Default Calling executables from VB

Why choose for an .exe instead of a .dll?


"Randall" schreef in bericht
...
What is the best way to exchange data between an executable and VB?

For example, I have an executable (Test.exe) that takes two input
variables
and then returns their sum. I use the Shell function:

RetVal = Shell("C:\Test.exe 3 4")

Test.exe returns 7 (3+4) but this value is not passed to VB (The value
returned by Shell is a Task ID number). How do I get the returned value
of
Test.exe in VB? Is there a better way to exchange data than using the
Shell
function?

The big picture objective here is to be able write computationally
intensive
routines in C and call them from within Excel VB.


Tx,

Randall