Can I run an external program?

  • Thread starter Thread starter simonclivehughes
  • Start date Start date
S

simonclivehughes

I'd like to be able have a routine that launches a PDF file. The
closest thing I can find it the ActivateMicrosoftApp Method which, of
course doesn't work with the Adobe product files.

Any ideas?
 
You will have to shell the AcroRd32.exe file, so you will need to get the
full path for that file.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
I tried the following:

Sub RunHelpFile()
' Specifying 1 as the second argument opens the application in
' normal size and gives it the focus.
Dim RetVal
RetVal = Shell("C:\Program Files\Coax Designer II\Coax Designer
II.pdf", 1) ' Run program.
End Sub

I get an "Invalid procedure call or argument (Error 5)" error message
however.
 
I tried the following:

Sub RunHelpFile()
' Specifying 1 as the second argument opens the application in
' normal size and gives it the focus.
Dim RetVal
RetVal = Shell("C:\Program Files\Coax Designer II\Coax Designer
II.pdf", 1) ' Run program.
End Sub

I get an "Invalid procedure call or argument (Error 5)" error message
however.
 
Thanks, Dick. I tried the following:

Sub RunHelpFile()
Dim sPath As String
sPath = "C:\Program Files\Coax Designer II\"
ActiveWorkbook.FollowHyperlink sPath & "CoaxDesignerII.pdf"
End Sub

but I get a Variable not defined error with the "CoaxDesignerII" (of
the filename) highlighted.
 
Instead of writing the code like this:
Sub RunHelpFile()
Dim sPath As String
sPath = "C:\Program Files\Coax Designer II\"
ActiveWorkbook.FollowHyperlink sPath & "CoaxDesignerII.pdf"
End Sub

It should have been written like this:
Sub RunHelpFile()
Dim sPath As String
sPath = "C:\Program Files\Coax Designer II\CoaxDesignerII.pdf"
ActiveWorkbook.FollowHyperlink sPath
End Sub

Swisse
 
Because the second one worked for me. I tested it before I posted here, and I
tested it again.

Swisse
 
My point is that the first works as well, so there is no '... should be ...'

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Actually, this version works best for me as I don't have to call the
host app (Acrobat Reader). The reason I'd rather not call this is that
I can't be sure of the version someone is running, nor the actual path
to it. This way, the file runs regardless.

Thanks,
 
The first one did not work for me - the reason for the should be. Try the
first one and report back.

Swisse
 
This version works best for me as it runs the file itself, so I don't
have to worry about the user having a different version of Acrobat
Reader.
 

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

Back
Top