View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Matthew Dyer Matthew Dyer is offline
external usenet poster
 
Posts: 178
Default close a pdf file opened via shellexecute

I am using the following code to open a pdf file.

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

strFile = 'assume strFile is opening without issue

ShellExecute 0, "open", strFile, vbNullString, vbNullString, 0



how can I close the PDF file with vba script? Thank you in advance!