Hello everyone,
I have been trying to automatically fill in an Internet Explorer form with values from an Excel spreadsheet. I am using the below VBA code to try and select an option from a drop box to begin with.
Sub InternetExplorerForm()
Dim IntExpl As Object
Set IntExpl = CreateObject("InternetExplorer.Application")
With IntExpl
.navigate "Zoll online - Formulare und Merkblätter"
.Visible = True
Do Until IntExpl.ReadyState = READYSTATE_COMPLETE
.Document.getElementById("f103950d103956").Value
Loop
End With
End Sub
However, I am getting an error stating that Method Document of object Iwebbrowser2 failed. I believe this is due to one of two reasons: either I am using the Document method incorrectly (in the IE object model Document is listed as an object rather than a method - perhaps an object declaration is needed) OR I am using the incorrect Document ID due to not being very good at understanding the source code. However, when using Developer - View - Class ID and information, I am getting the following info next to the drop box I am trying to manipulate ".form-group first-group #f103950d103956 "
Does anyone have an idea what I am doing wrong here? I would appreciate any nudge in the right direction since I have been trying for days to make this work.
Thank you very much!
Alex
I have been trying to automatically fill in an Internet Explorer form with values from an Excel spreadsheet. I am using the below VBA code to try and select an option from a drop box to begin with.
Sub InternetExplorerForm()
Dim IntExpl As Object
Set IntExpl = CreateObject("InternetExplorer.Application")
With IntExpl
.navigate "Zoll online - Formulare und Merkblätter"
.Visible = True
Do Until IntExpl.ReadyState = READYSTATE_COMPLETE
.Document.getElementById("f103950d103956").Value
Loop
End With
End Sub
However, I am getting an error stating that Method Document of object Iwebbrowser2 failed. I believe this is due to one of two reasons: either I am using the Document method incorrectly (in the IE object model Document is listed as an object rather than a method - perhaps an object declaration is needed) OR I am using the incorrect Document ID due to not being very good at understanding the source code. However, when using Developer - View - Class ID and information, I am getting the following info next to the drop box I am trying to manipulate ".form-group first-group #f103950d103956 "
Does anyone have an idea what I am doing wrong here? I would appreciate any nudge in the right direction since I have been trying for days to make this work.
Thank you very much!
Alex