Good morning
I am creating a formula that when writing a number called RTN, I returned the name after a web query, for example I put the number 08019002275485 in the RTN box and it returns the results of which I need the name "CONSULTING COMPANY IN INGIENERIA CONSULTING S DE RL "
The vba code is as follows
Function Registro(RTN As String)
Dim IE As Object
Dim Respuesta As String
Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "http://enlacertn.sar.gob.hn"
IE.Visible = True
While IE.busy
DoEvents
Wend
IE.document.All.Item("txtCriterio").Value = RTN
IE.document.All("btnBuscar").Click
Application.Wait (Now + TimeValue("0:00:03"))
Do Until IE.ReadyState = 4
DoEvents
Loop
Respuesta = IE.document.getElementById("LblNombre").innertext
Registro = Respuesta
IE.Quit
End Function
I need to extract the element Id = LblName but I returned an error the function
I enclose images for greater understanding
If you are so kind as to tell me where I have the error in the formula and explain a bit how the code would be to learn.
Thank you!