Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Declare Function SendMessage Lib "user32" _
Alias "SendMessageA" _
(ByVal hwnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Long) As Long
Const WM_SYSCOMMAND = &H112
Const SC_CLOSE = &HF060&
Sub CloseVBEWindow()
Dim lpClassName As String
Dim lpCaption As String
Dim hwnd As Long
lpClassName = "wndclass_desked_gsk"
hwnd = FindWindow(lpClassName, vbNullString)
hwnd = SendMessage(hwnd, WM_SYSCOMMAND, SC_CLOSE, 0&)
End Sub
or simply
Application.VBE.MainWindow.Visible = False
--
HTH
RP
(remove nothere from the email address if mailing direct)