YasserKhalil
Well-Known Member
Hello everyone
I am trying to use this simple code to open PDF file
I put Sample.pdf file in the same path of this workbook of course
I got a message like that
after clicking ok I got an error message
I installed adobe reader in this path
I have another working code
But I need to know the reason for the message error in the first code
Thanks advanced for help
I am trying to use this simple code to open PDF file
Code:
Sub TestIt()
ActiveWorkbook.FollowHyperlink ThisWorkbook.Path & "\Sample.pdf"
End Sub
I put Sample.pdf file in the same path of this workbook of course
I got a message like that

after clicking ok I got an error message

I installed adobe reader in this path
I have another working code
Code:
Sub RunPDF()
Dim myPath As String, myFile As String
myPath = "C:\Program Files\Adobe\Reader 10.0\Reader\AcroRd32.exe"
myFile = ThisWorkbook.Path & "\Sample.pdf"
Shell myPath & " " & myFile, vbNormalFocus
End Sub
But I need to know the reason for the message error in the first code
Thanks advanced for help