R
Rick S.
I have found this code below to be great for opening PD files, however I do
not know how to make it global through out my workbook.
That is with out pasting the code in each and every module I create
(including worksheet modules).
Any help is appreciated.
'======
'Author: Jean-Guy Marcil
'Place this before the first procedure, at the top of the module
Private 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
'This is the function that does the work
Public Sub OpenAcrobatFile(strFile As String)
ShellExecute 0, "open", strFile, vbNullString, vbNullString, 9
End Sub
'In a regular sub, use this to call the function to open the PDF file
without any warnings:
OpenAcrobatFile "C:\MyPath\FileName.pdf"
'======
--
Regards
VBA.Noob.Confused
XP Pro
Office 2007
not know how to make it global through out my workbook.
That is with out pasting the code in each and every module I create
(including worksheet modules).
Any help is appreciated.
'======
'Author: Jean-Guy Marcil
'Place this before the first procedure, at the top of the module
Private 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
'This is the function that does the work
Public Sub OpenAcrobatFile(strFile As String)
ShellExecute 0, "open", strFile, vbNullString, vbNullString, 9
End Sub
'In a regular sub, use this to call the function to open the PDF file
without any warnings:
OpenAcrobatFile "C:\MyPath\FileName.pdf"
'======
--
Regards
VBA.Noob.Confused
XP Pro
Office 2007