Open external application file with VBA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

To open an acrobat file say "abc.pdf", all I need to do is to double click on the file name and the file is opened. Can such file be opened using VBA code?
 
Hi
have a look at the Shell method in the VBA help. In your case: Open
Acrobat and add the filename as parameter for Acrobat.exe
 
Thanks Frank, I managed to run the application but how do I add the filename as parameter?
 
Hi
not sure how Acrobat want to have the file parameter. Take a look at
Adobes help how to start the Reader together with a file. Try this
manually in a DOS box for example
probably something like
AcroRd32 filename.pdf
 
Hi Francis

Try this to open an Acrobat file amending the paths / names as necessary,
Note it is all one line if text wraps.

Sub openpdf
Shell "C:\Program Files\Adobe\Acrobat 5.0\Acrobat\acrobat.exe " +
"C:\MyDocs\MyFolder\MyFile.pdf", 1
End Sub

--
XL2002
Regards

William

(e-mail address removed)

| Thank you very much Frank for all your help. Really appreciate it.
 

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