A family of Microsoft spreadsheet software with tools for analyzing, charting, and communicating data.
At the top of the code module, before and above any procedure, use the following Declare:
Private Declare Function FindExecutable _
Lib "shell32.dll" Alias "FindExecutableA" ( _
ByVal lpFile As String, ByVal lpDirectory As String, _
ByVal lpResult As String) As Long
Then, use the following procedure:
Sub OpenPDF()
Dim ExeName As String
Dim FileName As String
Dim N As Long
ExeName = String(260, 0)
FileName = "G:\Reference Documents\HP 16.pdf" '<<< CHANGE
N = FindExecutable(FileName, vbNullString, ExeName)
ExeName = Left(ExeName, InStr(1, ExeName, vbNullChar) - 1)
Shell ExeName & " " & Chr(34) & FileName & Chr(34), vbNormalFocus
End Sub
Change the line marked with <<< to the appropriate PDF file name.