Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
PJ PJ is offline
external usenet poster
 
Posts: 112
Default Launch program using Shell function

Thanks Rick, I initially tried with and without quotes and it didn't work. I
paid no mind to the error as I thought had to do with the syntax but I can
see now that the application is not listed in my path statement and therein
lies my problem. I will have to look for an alternative solution but thanks
for confirming the syntax.

PJ

"Rick Rothstein" wrote:

Use quote marks around the argument...

RetVal = Shell("CALC.EXE", 1)

--
Rick (MVP - Excel)


"PJ" wrote in message
...
Is it possible to launch an external program using VBA without specifying
the
application path? I want to launch a program where the location of the
executable will vary based on the version installed on the users machine.
The executable is the same regardless of the version installed and it
appears
there are at least four versions (and four locations) that could be
present
on the users machine.

So instead of this:
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1)

is there any way to achieve something like this:
RetVal = Shell(CALC.EXE, 1)


.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,934
Default Launch program using Shell function

I thought the CALC.EXE program resided in the System32 directory which I
thought was guaranteed to be in the Windows Path setting.

--
Rick (MVP - Excel)


"PJ" wrote in message
...
Thanks Rick, I initially tried with and without quotes and it didn't work.
I
paid no mind to the error as I thought had to do with the syntax but I can
see now that the application is not listed in my path statement and
therein
lies my problem. I will have to look for an alternative solution but
thanks
for confirming the syntax.

PJ

"Rick Rothstein" wrote:

Use quote marks around the argument...

RetVal = Shell("CALC.EXE", 1)

--
Rick (MVP - Excel)


"PJ" wrote in message
...
Is it possible to launch an external program using VBA without
specifying
the
application path? I want to launch a program where the location of the
executable will vary based on the version installed on the users
machine.
The executable is the same regardless of the version installed and it
appears
there are at least four versions (and four locations) that could be
present
on the users machine.

So instead of this:
RetVal = Shell("C:\WINDOWS\CALC.EXE", 1)

is there any way to achieve something like this:
RetVal = Shell(CALC.EXE, 1)


.


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Launch a program from Excel Nigel Excel Programming 1 March 6th 09 08:01 PM
script to launch a program from excel calvin Excel Discussion (Misc queries) 4 January 29th 09 09:12 PM
Help: is it possible to launch acommand prompt shell and have commands piped into it? Clinton M James[_2_] Excel Programming 2 February 27th 07 11:02 PM
Shell to another program from Excel Jimbo[_4_] Excel Programming 3 September 17th 06 03:23 PM
can vb from excel launch another program? Mr BT Excel Worksheet Functions 0 August 16th 06 05:37 PM


All times are GMT +1. The time now is 05:24 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"