load a PDF file with VBA



I have a userform that loads files and the user double clicks on file and I
want to be able to load a pdf file, I have tried the shell method and
createObject non of these work can someone help please.



Ron de Bruin

Have you try this


ActiveWorkbook.FollowHyperlink "C:\Test.pdf"

Or this example that Jim Rech posted

Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
(ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long

Sub LaunchPDF()
ShellExecute 0, "Open", "c:\File.pdf", "", "", 1
End Sub

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

Similar Threads

VBA and PDF files 1
Working with PDF files in VBA 1
How to load a PDF using Excel VBA 11
VBA and PDF 1
PDF files & Excel using VBA 2
VBA Codes to combine PDF files 3
print to pdf with vba 2
PDF document with VBA? 3