ARTHUR WESLEY
New Member
Hello,
I want to automate the generation of a specific pdf by the following url:
hhttp://consulta.tesouro.fazenda.gov.br/gru_novosite/gru_simples.asp
My aim is to fill all site fields through a macro.
I could already fill the UG. But I can not fill the Gestão, which is an DropDown.
Follows the code in VBA I am using:
I am filling the UG with "010001". I would like to select the following option in Gestão: "00001-TESOURO NACIONAL".
I do not know if I was clear.
If you could give me a hand I would appreciate it greatly. I have been there more than a week of it and nothing ...
Attached is my Excel spreadsheet.
Thank U!
I want to automate the generation of a specific pdf by the following url:
hhttp://consulta.tesouro.fazenda.gov.br/gru_novosite/gru_simples.asp
My aim is to fill all site fields through a macro.
I could already fill the UG. But I can not fill the Gestão, which is an DropDown.
Follows the code in VBA I am using:
Code:
Sub GRU_STN()
Dim ie As InternetExplorer
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate "https://consulta.tesouro.fazenda.gov.br/gru_novosite/gru_simples.asp"
Do Until ie.ReadyState = READYSTATE_COMPLETE
Loop
'The UG FILLING:
ie.Document.all.Item("frm").Item("codigo_favorecido").innerText = "010001"
ie.Document.forms.Item("frm").Item(0).onchange
'The GESTÃO FILLING: (THIS IS NOT WORKING):
ie.Document.getElementById("gestao").Focus
ie.Document.getElementById("gestao").selectedIndex = 1
ie.Document.getElementById("gestao").FireEvent ("onchange")
End Sub
I am filling the UG with "010001". I would like to select the following option in Gestão: "00001-TESOURO NACIONAL".
I do not know if I was clear.
If you could give me a hand I would appreciate it greatly. I have been there more than a week of it and nothing ...
Attached is my Excel spreadsheet.
Thank U!