ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to start an application from Excel VBA (https://www.excelbanter.com/excel-programming/358275-how-start-application-excel-vba.html)

[email protected]

How to start an application from Excel VBA
 
I would like to start an application from Excel VBA and pass command line
parameters to it. Once the app is started it should run completely
independently from the instance of Excel that started it.

Excel shouldn't wait on it to to anything (including terminate).

Thanks.

Chip Pearson

How to start an application from Excel VBA
 
See the Shell statement.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com


wrote in message
...
I would like to start an application from Excel VBA and pass
command line
parameters to it. Once the app is started it should run
completely
independently from the instance of Excel that started it.

Excel shouldn't wait on it to to anything (including
terminate).

Thanks.




[email protected]

How to start an application from Excel VBA
 
Thanks, I haven't tried it yet but it looks like exactly what I needed. I
tried "Spawn", "Execute", "Start" and several others, but I didn't think to
look up "Shell".

On Thu, 6 Apr 2006 17:15:48 -0500, "Chip Pearson"
wrote:

See the Shell statement.



JWM6

How to start an application from Excel VBA
 

The VBA shell command is as follows:

programPath = "C:\Program Files\Internet Explorer\iexplore.exe" '
works
'programPath = "iexplore.exe" ' does not work
Shell programPath + " " + fileToLaunch, vbNormalFocus

but the drawback is that the invoked program (iexplore.exe, at least in
my case) needs to have the FULL PATH to where the program exists = the
"C:\Program Files\Internet Explorer" which may or may not work on
someone elses computer. Is there a trick to find where the executing
program lives? This hardcoding will not work and is not transportable.

Thanks,


--
JWM6
------------------------------------------------------------------------
JWM6's Profile: http://www.excelforum.com/member.php...o&userid=33413
View this thread: http://www.excelforum.com/showthread...hreadid=530730


JWM6[_7_]

How to start an application from Excel VBA
 

Got the answer from this post
http://www.excelforum.com/showthread.php?t=53297

--
JWM
-----------------------------------------------------------------------
JWM6's Profile: http://www.excelforum.com/member.php...fo&userid=3341
View this thread: http://www.excelforum.com/showthread.php?threadid=53073



All times are GMT +1. The time now is 10:18 AM.

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