Getting output of a called external executale

T

Thorsten Walenzyk

Hi all,

I want to call an external executable (.exe in my case) from an Excel-VBA
program.
I found the Shell function, but with this function it is only possible to
get an integer return value back.

Is there is any possibility to use pipes to get the output of the external
program to VBA?

Thanks Thorsten
 
H

Helmut Weber

Hi,
if the prog produces character output,
you may direct the output to a file, maybe.
Like
shell "c:\prg\myprog.exe > c:\test.txt"
 
A

AA2e72E

Try:

Shell "Your.EXE > C:\MYFILE.TXT"

Then Open C:\MYFILE.TXT for Inpuit as #1
and read the contents of the file sequentially:

Line Input #1,A$

Use A$ in your VBA Code as required.
 
D

Dave Peterson

Maybe you could send the output from your .exe program into a text file and then
read that text file in code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top