This is my first post
I have to make a selection in a listbox which is on a web page with
VBA. I have the beginning of the code :
Sub extractTablesData()
'we define the essential variables
Dim IE As Object,
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
.navigate ("banrep.gov.co/es/tasas-cambio-mundo")
While IE.ReadyState <> 4
DoEvents
Wend
.Document.all ("P2")
.Document.all("P2").selectedIndex = Venta
.Document.all("P2").onchange
End Sub
the problem is that i don´t get the code to select the object i want from the list
this is the lnk to the web page:
ww.banrep.gov.co/es/tasas-cambio-mundo
where it says "tipo de tasa" i want to select "Venta" from vba code
and this is the sourse frm the web page:
<select name="P2" onchange="javascriptTPageChanged('o:go~r:report~v:compoundView!1~vivotTableView!1',this.options[this.selectedIndex].value)">
<option value="1 0" selected="">Compra</option>
<option value="1 1">Media</option>
<option value="1 2">Venta</option>
</select>
Thanks for your help it's very important.
I have to make a selection in a listbox which is on a web page with
VBA. I have the beginning of the code :
Sub extractTablesData()
'we define the essential variables
Dim IE As Object,
Set IE = CreateObject("InternetExplorer.Application")
With IE
.Visible = True
.navigate ("banrep.gov.co/es/tasas-cambio-mundo")
While IE.ReadyState <> 4
DoEvents
Wend
.Document.all ("P2")
.Document.all("P2").selectedIndex = Venta
.Document.all("P2").onchange
End Sub
the problem is that i don´t get the code to select the object i want from the list
this is the lnk to the web page:
ww.banrep.gov.co/es/tasas-cambio-mundo
where it says "tipo de tasa" i want to select "Venta" from vba code
and this is the sourse frm the web page:
<select name="P2" onchange="javascriptTPageChanged('o:go~r:report~v:compoundView!1~vivotTableView!1',this.options[this.selectedIndex].value)">
<option value="1 0" selected="">Compra</option>
<option value="1 1">Media</option>
<option value="1 2">Venta</option>
</select>
Thanks for your help it's very important.