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

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.
How did that not work?

Can you post the rest of the code?
 
Upvote 0

Forum statistics

Threads
1,215,355
Messages
6,124,468
Members
449,163
Latest member
kshealy

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