ник: Волшебник
Нет. Всё то, но не так.
Вот здесь подсказали и укоротили (убрали лищнее),
Option Compare Database
Option Explicit
Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function PostMessage Lib "user32" Alias "PostMessageA" _
(ByVal hWnd As Long, _
ByVal wMsg As Long, _
ByVal wParam As Long, _
lParam As Any) As Long
Private Const GetClose = &H10
Function CloseWindow(WindowName$)
Dim hw&
hw = FindWindow(vbNullString, WindowName)
If hw <> 0 Then CloseWindow = PostMessage(hw, GetClose, 0, vbNullString)
End Function
'Это вызов CloseWindow ("Сетевые подключения")