PDA

View Full Version : Insert data inside filed form in WEB



marreco
07-16-2014, 07:33 AM
Hi.

I'm trying to access and search a value on site within a VBA code.

Private Sub CommandButton1_Click()

Call Sheets("Plan1").WebBrowser1.Navigate("http://www.anp.gov.br/postos/consulta.asp")
Do While WebBrowser1.Busy = True
Loop

CNPJ = "14294227000100" 'I try insert value in field (CNPJ/CPF)
End Sub
Cross-Post
http://www.excelforum.com/excel-programming-vba-macros/1024215-insert-data-inside-filed-form-in-web.html

Thank you: pray2:

westconn1
07-17-2014, 03:44 AM
Call Sheets("Plan1").WebBrowser1.Navigate("http://www.anp.gov.br/postos/consulta.asp") Do While WebBrowser1.Busy = True
note in the first instance the webbrowser control is fully qualified, whereas the second is not, this may or may not present a problem, but should be avoided

what is CNPJ?

try like

wb.Navigate2 "http://www.anp.gov.br/postos/consulta.asp"
Do While wb.Busy = True
Loop
wb.Visible = True
wb.document.all("sCNPJ").Value = "14294227000100" 'I try insert value in field (CNPJ/CPF)