I'm trying to login into a page in Internet Explorer through a VBA code in Excel. The problem is my code doesn't recognize the Login and Password forms. Does anyone have any idea?
This is the website: http://www.trademap.org/
Here is my code:
Sub LoginTrademap ()
Dim i As Long
Dim IE As Object
Dim objElement As Object
Dim objCollection As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = True
IE.Navigate "http://www.trademap.org/"
Do While IE.Busy = True And IE.ReadyState <> 4
DoEvents
Loop
With IE.document
.getElementById("ctl00_MenuControl_marmenu_login").Click
End With ' Until here the code is running perfectly
With IE.Document
IE.Document.getElementById("ctl00_PageContent_Login1_UserName").Value = "[email protected]"
End With ' VBA doesn't recognize this form
With IE.Document
.getElementById("ctl00_PageContent_Login1_Password").Value = "exporta12"
End With ' VBA doesn't recognize this form
With IE.Document
.getElementById("ctl00_PageContent_Login1_Button").Click
End With
End Sub
Thanks.
Bookmarks