Bonjour,
Voilà une macro toute simple qui ouvre une fenêtre web.
Je voudrais que mon application Exel redevienne la fenêtre active après l'affichage de la fenêtre Internet.
J'ai essayé plein de choses trouvées sur ce forum et ailleurs. sans résultat aucun.
Impossible de rendre ma fenêtre active, c'est à dire en premier plan.
Quelqu'un aurait-il la solution ?
Ce bout de code est juste pour expliciter mon problème, la finalité est de télécharger un fichier .csv comme indiqué dans la variable l_url et poursuivre un traitement.
Code vba : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 Private Declare Function BringWindowToTop Lib "user32" _ (ByVal hwnd As Long) As Long Private Declare Function FindWindow Lib "user32" Alias _ "FindWindowA" (ByVal lpClassName As String, _ ByVal lpWindowName As String) As Long Private Declare Function ShowWindow Lib "user32" _ (ByVal hwnd As Long, ByVal nCmdShow As Long) As Long Sub ZoneLoad() Dim winHandle As Long Dim l_Url As String Dim winName As String winName = ActiveWindow.Caption winHandle = FindWindow(vbNullString, winName) ' l_Url = "http://s599720764.onlinehome.fr" & "/cartocistes/export_csv.php?idRegion=11" ActiveWorkbook.FollowHyperlink Address:="https://www.lemonde.fr/" 'BringWindowToTop winHandle ShowWindow winHandle, SW_SHOWNORMAL End Sub
Partager