'**********************************************************************************************
'Author:patricktoulon (france) on exceldownloads forum
'Model for Angie us microsoft US
'windows api with macro4
'api: SetWindowPos
'set the UserForm in the foreground
'
'**********************************************************************************************
'EXEMPLE
Private Sub UserForm_Activate()
Premier_Plan
End Sub
Sub Premier_Plan()
Dim hwnd&
hwnd = ExecuteExcel4Macro("CALL(""user32"",""GetActiveWindow"",""JCC"")")
ExecuteExcel4Macro ("CALL(""user32"",""SetWindowPos"",""JJJJJJJJ""," & hwnd & ", " & -1 & ", " & 0& & ", " & 0& & ", " & 0& & ", " & 0& & ", " & (&H1 Or &H2) & ")")
End Sub