Shell Command : Extremely Frustrated

G

Guest

I am having problems with the shell command in Excel 2003 trying to launch a
specific application from an Excel Macro.

My test procedures are as follows :

Sub Test1()
MsgBox Shell("c:\ausynch.exe",1) ' This does not launch the app
End Sub

The msgbox does return a value indicating the application has been launched
but the exe is not running/visible. If I run the command in the Run programme
or from DOS prompt the exe runs. If I replace c:\ausynch.exe in the code with
say notepad.exe or calc.exe or c:\Program Files\Internet
Explorer\IEXPLORE.EXE it works. The code simply does not work against the
ausynch.exe application.

If I run the procedure below I get the error msg "Run time error '5':
Invalid procedure or argument.

Sub Test2()
myApp = Shell("c:\ausynch.exe",1)
appActivate myApp
End Sub

Any help or test ideas would enormously appreciated.
JOHN.
 
D

DMoney

Try using the object instead of shell.


Private Sub Command4_Click()
Dim APword As Object
Set APword = CreateObject("word.APPLICATION")
APword.Visible = True
AppActivate APword
End Sub
-----Original Message-----
I am having problems with the shell command in Excel 2003 trying to launch a
specific application from an Excel Macro.

My test procedures are as follows :

Sub Test1()
MsgBox Shell("c:\ausynch.exe",1) ' This does not launch the app
End Sub

The msgbox does return a value indicating the application has been launched
but the exe is not running/visible. If I run the command in the Run programme
or from DOS prompt the exe runs. If I replace
c:\ausynch.exe in the code with
 

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