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
|
Option Explicit
'Microsoft HTML Object Library
'Microsoft Internet Controls
Sub googleMaps()
Dim ie As InternetExplorer
Dim IEdoc As HTMLObjectElement 'HTMLObjectElement nécessaire pour avoir autocomplétion sur IEdoc
Dim DOCelement As Object
Dim Helem As IHTMLElement 'type variable pour fonction getattribute("href")
Dim maPageHTML As HTMLDocument 'type variable pour déclencher un javascript.
Set ie = CreateObject("InternetExplorer.Application")
With ie
.navigate "https://accounts.google.com/ServiceLogin?service=local&hl=fr&nui=1&continue=http://maps.google.fr/maps/myplaces%3Fvpsrc%3D0%26ctz%3D-120%26abauth%3Da97a4e59:kPEvhF03FRog6EH01jjjugRUL-4%26vps%3D1%26jsv%3D368b%26sll%3D46.75984,1.738281%26sspn%3D7.10603,14.040527%26ei%3DVAp7TuSULo6XjweVzdTnCA%26num%3D10"
.Silent = False
.Visible = True
End With
Do Until ie.readyState = READYSTATE_COMPLETE
DoEvents
Loop
Set IEdoc = ie.document
IEdoc.getElementById("Email").Value = "********************"
IEdoc.getElementById("Passwd").Value = "******************"
IEdoc.forms(0).submit
Do Until ie.readyState = READYSTATE_INTERACTIVE
DoEvents
Loop
'jusqu'ici fonctionne parfaitement sous IE8 windowsXPsp3 excel 2010 et types : HTMLObjectElement + IHTMLElement
Set maPageHTML = ie.document
maPageHTML.parentWindow.execScript "'mp.createMap(essai_1)';", "javascript"
End Sub |
Partager