Reputation: 11
I'm currently having a bit of a problem, because i can't create a proper VBA code for my excel to enter data from cell to particular website. Could You please help me with it ?
Sub MSC()
Dim OrgBox As HTMLInputElement
Set objIE = New SHDocVw.InternetExplorer
objIE.navigate "http://www.mscgva.ch/tracking/index.html"
objIE.Visible = True
Do While objIE.readyState < 4: Loop
Set OrgBox = objIE.getElementById("InputBox")
OrgBox.Value = Range("a1")
OrgBox.form.submit
End Sub
Upvotes: 1
Views: 120
Reputation: 1378
The element you're trying to control is in an iframe. To control elements inside an iframe, you need to extract the src attribute from the tag and navigate to that URL
ifr_url = ie.document.getElementsByTagName("iframe")(0).src
in your case ifr_url = "http://tracking.mscgva.ch/msctracking.php"
Once on that webpage your code to insert text should work.
Upvotes: 1