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 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88
| Sub PremierIE()
'Déclaration des variables
Dim IE As Object
Dim IEDoc As HTMLDocument
Dim InputZoneTexte1 As HTMLInputElement
Dim InputafficherBouton As HTMLInputElement
Dim CaseDirect As HTMLInputElement
Dim Generic As HTMLGenericElement
Dim iCollection As IHTMLElementCollection
'Initialisation des variables
Set IE = CreateObject("InternetExplorer.Application")
'Suite du code
'Chargement d'une page web Google
IE.Navigate "adresse du site en local"
'Affichage de la fenêtre IE
IE.Visible = True
'On attend le chargement complet de la page
Call wait
'On pointe le membre Document
Set IEDoc = IE.document
'On pointe notre Zone de texte 1
Set InputZoneTexte1 = IEDoc.all("ReportViewerControl$ctl04$ctl03$txtValue")
'On définit le texte que l'on souhaite placer à l'intérieur
InputZoneTexte1.Value = "03/06/2014 06:00:00"
'On pointe notre Zone de texte 2
Set InputZoneTexte1 = IEDoc.all("ReportViewerControl$ctl04$ctl05$txtValue")
'On définit le texte que l'on souhaite placer à l'intérieur
InputZoneTexte1.Value = "04/06/2014 11:00:00"
'On pointe la case à cocher
Set CaseDirect = IEDoc.all("ReportViewerControl_ctl04_ctl07_divDropDown_ctl01")
'On simule un clic sur la case à cocher
CaseDirect.Click
'On attend la fin de la recherche
Call wait
'On pointe notre bouton
Set InputrechercheBouton = IEDoc.all("ReportViewerControl$ctl04$ctl00")
'On simule un clic
InputrechercheBouton.Click
'On attend la fin de la recherche
Call wait
'[...] Suite du code
'On libère les variables
Set IEDoc = Nothing
Set IE = Nothing
End Sub
Sub wait()
Pausetime = 3
Start = Timer
Do While Timer < Start + Pausetime
DoEvents
Loop
End Sub |
Partager