Sub Essai_extract_GTBU()
'Déclaration des variables
Dim IE As New InternetExplorer
Dim IEDoc As HTMLDocument
Dim InputUSer, InputPassword As HTMLInputElement
Dim InputClick As HTMLInputElement
'Ouverture du portail GTBU
IE.navigate "https://xxxx"
'Affichage de la fenêtre IE
IE.Visible = True
'On attend le chargement complet de la page
WaitIE IE
'Identification et connexion
Set IEDoc = IE.document
Set InputUSer = IEDoc.all("j_username")
InputUSer.Value = "xxxx"
Set InputUSer = IEDoc.all("j_password")
InputUSer.Value = "xxxx"
Set InputClick = IEDoc.all("uidPasswordLogon")
InputClick.Click
'On attend la fin de la recherche
WaitIE IE
Set IEDoc = IE.document
Set InputClick = IEDoc.getElementById("WD55")
InputClick.Click
'On libère la variable IE
Set IE = Nothing
'
End Sub
Sub WaitIE(IE As InternetExplorer)
'On boucle tant que la page n'est pas totalement chargée
Do Until IE.readyState = READYSTATE_COMPLETE
DoEvents
Loop
End Sub
Partager