Sub FlashReportAutomation()
Dim web As Object
Dim doc As HTMLDocument
Set web = CreateObject("internetexplorer.application")
web.Visible = True
web.navigate "http://google.com"
Do While web.Busy
Application.Wait DateAdd("s", 2, Now)
Loop
Set doc = web.Document
web.Document.getElementsByName("q").Value = "Robert"
End Sub
I'm unable to get this working, if element ID is not mentioned. Any help?
I agree with the suggestion given by Tim Williams regarding passing the index number for the element with the name 'Q'.
Another thing I noticed is that in the line below you have set the document object.
Set doc = web.DocumentWhile assigning the value to the element, you are again using the document. It will generate an error.
web.Document.getElementsByName("q").Value = "Robert"Your code should be like below.
You could try like this and let us know if you have questions.