Cette action est irreversible, confirmez la suppression du commentaire ?
Signaler le commentaire
Veuillez sélectionner un problème
Nudité
Violence
Harcèlement
Fraude
Vente illégale
Discours haineux
Terrorisme
Autre
MichDenis
En supposant que tu as une instance d'internet explorer d'ouvert :
Voici un bout de code de Michel Perron :
'Déclaration des API dans le haut d'un module standard : Option Explicit Private Declare Function GetDesktopWindow Lib "user32" () As Long Private Declare Function GetWindow& Lib "user32" (ByVal hwnd&, ByVal wCmd&) Private Declare Function GetWindowLong& Lib "user32" _ Alias "GetWindowLongA" (ByVal hwnd&, ByVal nIndex&) Private Declare Function GetWindowText& Lib "user32" Alias _ "GetWindowTextA" (ByVal hwnd&, ByVal lpString$, ByVal aint&) Private Const mconMAXLEN = 255 '---------------------------------- Sub Activer_Fenêtre_Internet_Explorer() Dim hwnd&, Style&, Title$, i& hwnd = GetWindow(GetDesktopWindow(), 5) Do While hwnd Title = GetCaption(hwnd) If Len(Title) Then ' Enum visible windows only If GetWindowLong(hwnd, -16) And &H10000000 Then If InStr(1, Title, "Internet explorer", 1) Then AppActivate Title Exit Sub End If End If End If hwnd = GetWindow(hwnd, 2) Loop End Sub '---------------------------------- Private Function GetCaption(hwnd&) As String Dim i%, Buffer$: Buffer = String$(254, 0) i = GetWindowText(hwnd, Buffer, 255) If i Then GetCaption = Left$(Buffer, i) End Function '----------------------------------
"Infogroup" a écrit dans le message de groupe de discussion : # Bonjour à tous,
depuis une feuil " Feuil1 ", je cherche à activer la fenêtre d'Internet Explorer qui elle est déjà ouverte.
Pouvez-vous m'indiquer quelle est l'instruction VBA à utiliser ?
A noter également qu'il peut y avoir d'autres fenêtre ouvertes comme Word ou d'autres.
Merci pour vous réponses
CDL
Infogroup
En supposant que tu as une instance d'internet explorer d'ouvert :
Voici un bout de code de Michel Perron :
'Déclaration des API dans le haut d'un module standard :
Option Explicit
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetWindow& Lib "user32" (ByVal hwnd&, ByVal wCmd&)
Private Declare Function GetWindowLong& Lib "user32" _
Alias "GetWindowLongA" (ByVal hwnd&, ByVal nIndex&)
Private Declare Function GetWindowText& Lib "user32" Alias _
"GetWindowTextA" (ByVal hwnd&, ByVal lpString$, ByVal aint&)
Private Const mconMAXLEN = 255
'----------------------------------
Sub Activer_Fenêtre_Internet_Explorer()
Dim hwnd&, Style&, Title$, i&
hwnd = GetWindow(GetDesktopWindow(), 5)
Do While hwnd
Title = GetCaption(hwnd)
If Len(Title) Then
' Enum visible windows only
If GetWindowLong(hwnd, -16) And &H10000000 Then
If InStr(1, Title, "Internet explorer", 1) Then
AppActivate Title
Exit Sub
End If
End If
End If
hwnd = GetWindow(hwnd, 2)
Loop
End Sub
'----------------------------------
Private Function GetCaption(hwnd&) As String
Dim i%, Buffer$: Buffer = String$(254, 0)
i = GetWindowText(hwnd, Buffer, 255)
If i Then GetCaption = Left$(Buffer, i)
End Function
'----------------------------------
"Infogroup" <Infogroup70@orange.fr> a écrit dans le message de groupe de discussion :
#SH2Nn5CKHA.5780@TK2MSFTNGP03.phx.gbl...
Bonjour à tous,
depuis une feuil " Feuil1 ", je cherche à activer la fenêtre d'Internet
Explorer qui elle est déjà ouverte.
Pouvez-vous m'indiquer quelle est l'instruction VBA à utiliser ?
A noter également qu'il peut y avoir d'autres fenêtre ouvertes comme Word ou
d'autres.
En supposant que tu as une instance d'internet explorer d'ouvert :
Voici un bout de code de Michel Perron :
'Déclaration des API dans le haut d'un module standard : Option Explicit Private Declare Function GetDesktopWindow Lib "user32" () As Long Private Declare Function GetWindow& Lib "user32" (ByVal hwnd&, ByVal wCmd&) Private Declare Function GetWindowLong& Lib "user32" _ Alias "GetWindowLongA" (ByVal hwnd&, ByVal nIndex&) Private Declare Function GetWindowText& Lib "user32" Alias _ "GetWindowTextA" (ByVal hwnd&, ByVal lpString$, ByVal aint&) Private Const mconMAXLEN = 255 '---------------------------------- Sub Activer_Fenêtre_Internet_Explorer() Dim hwnd&, Style&, Title$, i& hwnd = GetWindow(GetDesktopWindow(), 5) Do While hwnd Title = GetCaption(hwnd) If Len(Title) Then ' Enum visible windows only If GetWindowLong(hwnd, -16) And &H10000000 Then If InStr(1, Title, "Internet explorer", 1) Then AppActivate Title Exit Sub End If End If End If hwnd = GetWindow(hwnd, 2) Loop End Sub '---------------------------------- Private Function GetCaption(hwnd&) As String Dim i%, Buffer$: Buffer = String$(254, 0) i = GetWindowText(hwnd, Buffer, 255) If i Then GetCaption = Left$(Buffer, i) End Function '----------------------------------
"Infogroup" a écrit dans le message de groupe de discussion : # Bonjour à tous,
depuis une feuil " Feuil1 ", je cherche à activer la fenêtre d'Internet Explorer qui elle est déjà ouverte.
Pouvez-vous m'indiquer quelle est l'instruction VBA à utiliser ?
A noter également qu'il peut y avoir d'autres fenêtre ouvertes comme Word ou d'autres.
Merci pour vous réponses
CDL
Infogroup
Infogroup
Merci infiniment à toi MichDenis, c'est absolument nickel
Cdl
Infogroup
"MichDenis" a écrit dans le message de news:
En supposant que tu as une instance d'internet explorer d'ouvert :
Voici un bout de code de Michel Perron :
'Déclaration des API dans le haut d'un module standard : Option Explicit Private Declare Function GetDesktopWindow Lib "user32" () As Long Private Declare Function GetWindow& Lib "user32" (ByVal hwnd&, ByVal wCmd&) Private Declare Function GetWindowLong& Lib "user32" _ Alias "GetWindowLongA" (ByVal hwnd&, ByVal nIndex&) Private Declare Function GetWindowText& Lib "user32" Alias _ "GetWindowTextA" (ByVal hwnd&, ByVal lpString$, ByVal aint&) Private Const mconMAXLEN = 255 '---------------------------------- Sub Activer_Fenêtre_Internet_Explorer() Dim hwnd&, Style&, Title$, i& hwnd = GetWindow(GetDesktopWindow(), 5) Do While hwnd Title = GetCaption(hwnd) If Len(Title) Then ' Enum visible windows only If GetWindowLong(hwnd, -16) And &H10000000 Then If InStr(1, Title, "Internet explorer", 1) Then AppActivate Title Exit Sub End If End If End If hwnd = GetWindow(hwnd, 2) Loop End Sub '---------------------------------- Private Function GetCaption(hwnd&) As String Dim i%, Buffer$: Buffer = String$(254, 0) i = GetWindowText(hwnd, Buffer, 255) If i Then GetCaption = Left$(Buffer, i) End Function '----------------------------------
"Infogroup" a écrit dans le message de groupe de discussion : # Bonjour à tous,
depuis une feuil " Feuil1 ", je cherche à activer la fenêtre d'Internet Explorer qui elle est déjà ouverte.
Pouvez-vous m'indiquer quelle est l'instruction VBA à utiliser ?
A noter également qu'il peut y avoir d'autres fenêtre ouvertes comme Word ou d'autres.
Merci pour vous réponses
CDL
Infogroup
Merci infiniment à toi MichDenis, c'est absolument nickel
Cdl
Infogroup
"MichDenis" <michdenis@hotmail.com> a écrit dans le message de
news:uuFskz5CKHA.1252@TK2MSFTNGP04.phx.gbl...
En supposant que tu as une instance d'internet explorer d'ouvert :
Voici un bout de code de Michel Perron :
'Déclaration des API dans le haut d'un module standard :
Option Explicit
Private Declare Function GetDesktopWindow Lib "user32" () As Long
Private Declare Function GetWindow& Lib "user32" (ByVal hwnd&, ByVal
wCmd&)
Private Declare Function GetWindowLong& Lib "user32" _
Alias "GetWindowLongA" (ByVal hwnd&, ByVal nIndex&)
Private Declare Function GetWindowText& Lib "user32" Alias _
"GetWindowTextA" (ByVal hwnd&, ByVal lpString$, ByVal aint&)
Private Const mconMAXLEN = 255
'----------------------------------
Sub Activer_Fenêtre_Internet_Explorer()
Dim hwnd&, Style&, Title$, i&
hwnd = GetWindow(GetDesktopWindow(), 5)
Do While hwnd
Title = GetCaption(hwnd)
If Len(Title) Then
' Enum visible windows only
If GetWindowLong(hwnd, -16) And &H10000000 Then
If InStr(1, Title, "Internet explorer", 1) Then
AppActivate Title
Exit Sub
End If
End If
End If
hwnd = GetWindow(hwnd, 2)
Loop
End Sub
'----------------------------------
Private Function GetCaption(hwnd&) As String
Dim i%, Buffer$: Buffer = String$(254, 0)
i = GetWindowText(hwnd, Buffer, 255)
If i Then GetCaption = Left$(Buffer, i)
End Function
'----------------------------------
"Infogroup" <Infogroup70@orange.fr> a écrit dans le message de groupe de
discussion :
#SH2Nn5CKHA.5780@TK2MSFTNGP03.phx.gbl...
Bonjour à tous,
depuis une feuil " Feuil1 ", je cherche à activer la fenêtre d'Internet
Explorer qui elle est déjà ouverte.
Pouvez-vous m'indiquer quelle est l'instruction VBA à utiliser ?
A noter également qu'il peut y avoir d'autres fenêtre ouvertes comme Word
ou
d'autres.
Merci infiniment à toi MichDenis, c'est absolument nickel
Cdl
Infogroup
"MichDenis" a écrit dans le message de news:
En supposant que tu as une instance d'internet explorer d'ouvert :
Voici un bout de code de Michel Perron :
'Déclaration des API dans le haut d'un module standard : Option Explicit Private Declare Function GetDesktopWindow Lib "user32" () As Long Private Declare Function GetWindow& Lib "user32" (ByVal hwnd&, ByVal wCmd&) Private Declare Function GetWindowLong& Lib "user32" _ Alias "GetWindowLongA" (ByVal hwnd&, ByVal nIndex&) Private Declare Function GetWindowText& Lib "user32" Alias _ "GetWindowTextA" (ByVal hwnd&, ByVal lpString$, ByVal aint&) Private Const mconMAXLEN = 255 '---------------------------------- Sub Activer_Fenêtre_Internet_Explorer() Dim hwnd&, Style&, Title$, i& hwnd = GetWindow(GetDesktopWindow(), 5) Do While hwnd Title = GetCaption(hwnd) If Len(Title) Then ' Enum visible windows only If GetWindowLong(hwnd, -16) And &H10000000 Then If InStr(1, Title, "Internet explorer", 1) Then AppActivate Title Exit Sub End If End If End If hwnd = GetWindow(hwnd, 2) Loop End Sub '---------------------------------- Private Function GetCaption(hwnd&) As String Dim i%, Buffer$: Buffer = String$(254, 0) i = GetWindowText(hwnd, Buffer, 255) If i Then GetCaption = Left$(Buffer, i) End Function '----------------------------------
"Infogroup" a écrit dans le message de groupe de discussion : # Bonjour à tous,
depuis une feuil " Feuil1 ", je cherche à activer la fenêtre d'Internet Explorer qui elle est déjà ouverte.
Pouvez-vous m'indiquer quelle est l'instruction VBA à utiliser ?
A noter également qu'il peut y avoir d'autres fenêtre ouvertes comme Word ou d'autres.