VBA to change field value and click button Internet Explorer

felipers

New Member
Joined
Jan 17, 2018
Messages
1
Hi all -

I am having a hard time figuring out how to access a certain field, change its value and click a button.
The URL I am accessing is "http://www.anbima.com.br/pt_br/informar/taxas-de-titulos-publicos.htm" and the first thing I am trying to do is change the date in the date field on the RHS.

The HTML for this field I believe is the following:

HTML:
input type="text" name="Dt_Ref" value="16/01/2018" maxlength="10" size="10" class="form_data" onblur="formatCamp(this, 'date')" onkeypress="return(validaConteudo(event, this, 'date'))" onkeyup="saltaCampo(event, this, 'date',8)" onfocus="removeCaracs(this, 'date')"

I tried the following VBA code without success:

Code:
IE.document.getElementsByName("Dt_Ref")(0).Value = "17/01/2018"

After managing to do this I would like to click the "Consultar" button. How do I do this as well?

Thanks a lot.
 

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type
How did that not work?

Can you post the rest of the code?
 
Upvote 0

Forum statistics

Threads
1,215,370
Messages
6,124,526
Members
449,169
Latest member
mm424

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top