Hellboy007
Technical User
Hi
I have created a xla file. The main purpuse of that file, is to be able to
copy the code lines of the selected VBProject on to the clipboard. In that
file, i have created 2 userforms. The goal of the first one when called
upon, is to present in a TreeView control, all the Procedure that are
present in the selected vbaproject.
Now, the trouble that I have is that when i call the userform(show), two
things occur that I dont Want:
1- I Go back in Excel, insted of staying in VBE
2- When I unload the userform, I dont go back to the Vbaproject that a
selected before I call the Userform, i usually go back to the vbaproject
that contains my userform module.
So:
How I can I stay In vbe, while calling a userform ?
And :
How can I go back to the VbaProject that I was on before calling the
Userform when I unload it from the memorie. (this is how the sequence end
with)
Thank's
Philippe
p.s. I have receved this code that seam to work but i still go back on my userform sheet call upon !
Public Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Property Get Hwnd() As Long
Hwnd = FindWindow(vbNullString, Caption)
End Property
With Application.VBE.MainWindow
If .Visible And Not .WindowState = 1 Then 'minimized
.SetFocus
Call SetParent(Me.Hwnd, .Hwnd)
End If
End With
Repaint
I have created a xla file. The main purpuse of that file, is to be able to
copy the code lines of the selected VBProject on to the clipboard. In that
file, i have created 2 userforms. The goal of the first one when called
upon, is to present in a TreeView control, all the Procedure that are
present in the selected vbaproject.
Now, the trouble that I have is that when i call the userform(show), two
things occur that I dont Want:
1- I Go back in Excel, insted of staying in VBE
2- When I unload the userform, I dont go back to the Vbaproject that a
selected before I call the Userform, i usually go back to the vbaproject
that contains my userform module.
So:
How I can I stay In vbe, while calling a userform ?
And :
How can I go back to the VbaProject that I was on before calling the
Userform when I unload it from the memorie. (this is how the sequence end
with)
Thank's
Philippe
p.s. I have receved this code that seam to work but i still go back on my userform sheet call upon !
Public Declare Function FindWindow Lib "user32.dll" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Public Declare Function SetParent Lib "user32.dll" (ByVal hWndChild As Long, ByVal hWndNewParent As Long) As Long
Property Get Hwnd() As Long
Hwnd = FindWindow(vbNullString, Caption)
End Property
With Application.VBE.MainWindow
If .Visible And Not .WindowState = 1 Then 'minimized
.SetFocus
Call SetParent(Me.Hwnd, .Hwnd)
End If
End With
Repaint