TaskKill /FI "WINDOWTITLE eq [COLOR="blue"]FileName[/COLOR].pdf[COLOR="red"]*[/COLOR]"
Sure thing! A fully automated routine wouldn't require opening the file. The suggestion was just a workaround to the current problem in the meantime.Well the entire idea of having the file open for human perusal is redundant if one can read the contents, hence closing/killing it is irrelevant since the file does not get opened![]()
Application.FollowHyperlink "pathToFile"
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" _
(ByVal hWnd As Long, ByVal lpszOp As String, _
ByVal lpszFile As String, ByVal lpszParams As String, _
ByVal LpszDir As String, ByVal FsShowCmd As Long) _
As Long
Call ShellExecute(0&, "open", "PathToFile", strParam, "", SW_SHOWNORMAL)