jayinthe813
New member
- Local time
- , 17:12
- Joined
- Sep 6, 2012
- Messages
- 6
So im stuck trying to figure out how to enter data into a web form field via VBA, without using its ID via DOM (referenced MSHTML and MS internet controls). I have this code below:
Which works perfectly, but the next page I get to, the text field i need to add a variable into only has a Name, and not ID:
I have set the above code which should grab the name, but it will not let me do
.value OR .setattribute, (it appears getelementbyid can) so I dont know how to tell it to insert my variable into the field, then click submit.
I have scoured google, but the only thing I can really find on this concerns javascript, and yet it should be very similar (using DOM), but those cases are still using the ID to get the element. Anyone have any ideas? :banghead:
Code:
Dim HTMLDoc As MSHTML.HTMLDocument(browser functions)
Set HTMLDoc = Browser.document With HTMLDoc .getElementById("USER").setAttribute "value", "employee" .getElementById("PASSWORD").setAttribute "value", "pass" .getElementById("Button").click End With
Code:
[SIZE=4]<TD align=left ><INPUT class=data name=dataNum size=9 maxlength=9> </TD>[/SIZE]
Code:
.getElementsByName ("dataNum")
.value OR .setattribute, (it appears getelementbyid can) so I dont know how to tell it to insert my variable into the field, then click submit.
I have scoured google, but the only thing I can really find on this concerns javascript, and yet it should be very similar (using DOM), but those cases are still using the ID to get the element. Anyone have any ideas? :banghead: