Gruppe
API
Problem
Wie kann ich mit dem Start einer UserFor in die Entwicklungsumgebung wechseln?
StandardModule: Modul1
Sub DialogAufruf()
frmVBIDE.Show
End Sub
ClassModule: frmVBIDE
Private Declare Function FindWindowA Lib "user32" _
(ByVal lpClassName As String, _
ByVal lpWindowName As String) As Long
Private Declare Function SetParent Lib "user32" _
(ByVal hWndChild As Long, _
ByVal hWndNewParent As Long) As Long
Private Sub CommandButton1_Click()
Unload Me
End Sub
Sub UserForm_Initialize()
Dim lReturn As Long
Dim lHWnd As Long
Dim lVBEHWnd As Long
lVBEHWnd = Application.VBE.MainWindow.hWnd
lHWnd = FindWindowA("ThunderXFrame", vbNullString)
lReturn = SetParent(lHWnd, lVBEHWnd)
Application.VBE.MainWindow.SetFocus
End Sub