ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Getting output of a called external executale (https://www.excelbanter.com/excel-programming/317793-getting-output-called-external-executale.html)

Thorsten Walenzyk

Getting output of a called external executale
 
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



AA2e72E

Getting output of a called external executale
 
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.


"Thorsten Walenzyk" wrote:

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




Dave Peterson[_5_]

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

Thorsten Walenzyk wrote:

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


--

Dave Peterson


All times are GMT +1. The time now is 01:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com