I am writing a macro that enter data into a online calculator and get the computed results
Link: https://www.icao.int/environmental-protection/CarbonOffset/Pages/default.aspx
I am trying to fill the values of "from city/airport" in the website.
Here is my Code:
Sub get_CO2()
Dim ie As Object
Set ie = New InternetExplorerMedium
ie.Navigate "https://applications.icao.int/icec"
Do While ie.ReadyState <> 4: DoEvents: Loop
ie.Visible = True
With ie.Document
.getElementById("passengerNo").Value = 7
.getElementById("select1").selectedIndex = 1
.getElementById("select2").selectedIndex = 1
' .getElementByName("frm1").Value = "XXX"
' .getElementByName("to1").Value = "XXX"
.getElementById("computeByInput").Click
End With
End Sub
It is doesnt work. It shows "object do not support this property or method" How can i fill in this kind of types? What function can i use? If the airport code is not known, is there anyway to enter the name of the country and just pick to first option showing up?