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
| Declare PtrSafe Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As Long
Declare PtrSafe Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Public Const MOUSEEVENTF_LEFTDOWN = &H2
Public Const MOUSEEVENTF_LEFTUP = &H4
Public Const MOUSEEVENTF_RIGHTDOWN As Long = &H8
Public Const MOUSEEVENTF_RIGHTUP Public Sub CreerNavigateur()
Dim oNav As SHDocVw.InternetExplorer
Dim oDoc As MSHTML.HTMLDocument
Set oNav = New SHDocVw.InternetExplorer
oNav.Visible = True
'oNav.navigate "http://google.fr"
oNav.Navigate "http://www.abcbourse.com/download/historiques.aspx"
' Attente avec timeout de 10 s
If WaitIE(oNav, 10) Then
' 10 s écoulées et page non chargée
MsgBox "Time out!"
Else
' Page chargée, on continue
Set oDoc = oNav.Document
' modification de la Valeur date
oDoc.getElementsByName("ctl00$BodyABC$strDateDeb")(0).Value = "26/05/2015" 'la variable entre () => afficher la page et faire afficher la source rechercher la variable
oDoc.getElementsByName("ctl00$BodyABC$strDateFin")(0).Value = "26/05/2016"
'modification du n° de la valeur
oDoc.getElementsByName("ctl00$BodyABC$txtOneSico")(0).Value = "FR0000120222"
'activer la coche
oDoc.getElementsByName("ctl00$BodyABC$oneSico")(0).Click
' Clic sur bouton telecharger
oDoc.getElementsByName("ctl00$BodyABC$Button1")(0).ClickAs Long = &H10 |
Partager