Private Declare Function FindWindowA Lib "user32" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function GetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long) As Long
Private Declare Function SetWindowLongA Lib "user32" (ByVal hwnd As Long, ByVal nIndex As Long, ByVal dwNewLong As Long) As Long
Private Declare Function SetParent Lib "user32" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Private Const WS_CHILD = &H40000000
Private Const WS_POPUP = &H80000000
Private Const GWL_STYLE = (-16)
Private Sub UserForm_Initialize()
Dim X As Long, Y As Long, z As Long
X = FindWindowA(vbNullString, Me.Caption)
Y = GetWindowLongA(X, GWL_STYLE)
Y = Y And Not WS_POPUP Or WS_CHILD
Y = SetWindowLongA(X, GWL_STYLE, Y)
z = SetParent(X, Application.hwnd)
End Sub