
Declare Function FindWindow Lib "user32" Alias _
"FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Declare Function PostMessage Lib "user32" Alias _
"PostMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, _
ByVal wParam As Long, lParam As Any) As Long
Public Const WM_CLOSE = &H10
Y para encontrar la ventana y cerrarla :
Dim winHwnd As Long
Dim RetVal As Long
winHwnd = FindWindow("IEFrame", vbNullString)
If winHwnd <> 0 Then
RetVal = PostMessage(winHwnd, WM_CLOSE, 0&, 0&)
If RetVal = 0 Then
MsgBox "Error enviando mensaje."
End If
Else
MsgBox "El IExplorer no está abierto."
End If

