Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capturing Output From Shell

Status
Not open for further replies.

gharabed

Programmer
Sep 7, 2001
251
US
I don't know if "shell" can be used to do this but I want to run an external .exe file that sends text output to the screen/standard out. Is there a way to run an external program and capture the output into a local variable within VBA? For example, say have a program called "add.exe" that takes two numbers as input and outputs the sum. Thus, if I were to run the program from a DOS shell I would type something like:

sum.exe 5 10

The result would output: 15

I want to be able to issue that command and capture the value "15" in a local variable within my VBA program. Since "shell" is a sub I figure there is no way to do it ( I apologize for not having any documentation for shell in front of me.)

Help is appreciated.

Thanks,
Greg
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top