Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Shell Command : Extremely Frustrated

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.




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default Shell Command : Extremely Frustrated

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
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.




.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,069
Default Shell Command : Extremely Frustrated

Many thanks. I will look at this, although I suspect it will not resolve my
problem. The reason being I need a function that returns a value (like the
shell command) that I can use subsequently to test if the application is
running. This is done in a ShellAndWait function.
http://groups.google.com/groups?thre...%40tkmsftngp03


John.

"DMoney" wrote:

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
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.




.


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
Shell Command JOHN Excel Programming 1 November 17th 04 10:39 AM
Shell command MAx Excel Programming 2 June 4th 04 04:11 PM
xp shell command using vba Sudhendra Excel Programming 2 February 16th 04 05:56 AM
Closing DOS window after shell command Garry Boswell Excel Programming 1 January 9th 04 10:32 PM
SHELL command Robin Clay[_3_] Excel Programming 3 October 17th 03 02:50 PM


All times are GMT +1. The time now is 06:28 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"