ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   filling web forms from excel (https://www.excelbanter.com/excel-programming/392887-filling-web-forms-excel.html)

iCalculate

filling web forms from excel
 
Hi,

I need to develope a solution which will fill up web forms directly
from excel. Sub should loop trough cells and automatically submit each
data input. I found an earlier post "Filling out usernames in IE", but
when I try to use it with google.com for example within this code
posted by 6/10/2006 9:30:22 AM by: Randy Harmelink, quote:

Sub google_search()
Set oForm = oIE.Document.forms(0)
For Each oCell In Sheets(1).Range("A1:A500")
If oCell.Value = "" Then Exit For
oForm("f").Value = oCell.Offset(0, 0)
oForm(".save2").Click
Do: DoEvents: Loop While oIE.Busy
Do: DoEvents: Loop Until oIE.ReadyState = READYSTATE_COMPLETE
Set oForm = oIE.Document.forms(0)
Next oCell
oForm(".cancel").Click
End Sub


I've changed it a bit to suit my needs. When i run this it displays
error msg "Object required" on line "Set oForm =
oIE.Document.forms(0)". I have references set to minrosoft internet
controls. I don't know what else to do. Please advise on this. Thanks.


Tim Williams

filling web forms from excel
 
You haven't set the oIE variable.

Tim


"iCalculate" wrote in message
oups.com...
Hi,

I need to develope a solution which will fill up web forms directly
from excel. Sub should loop trough cells and automatically submit each
data input. I found an earlier post "Filling out usernames in IE", but
when I try to use it with google.com for example within this code
posted by 6/10/2006 9:30:22 AM by: Randy Harmelink, quote:

Sub google_search()
Set oForm = oIE.Document.forms(0)
For Each oCell In Sheets(1).Range("A1:A500")
If oCell.Value = "" Then Exit For
oForm("f").Value = oCell.Offset(0, 0)
oForm(".save2").Click
Do: DoEvents: Loop While oIE.Busy
Do: DoEvents: Loop Until oIE.ReadyState = READYSTATE_COMPLETE
Set oForm = oIE.Document.forms(0)
Next oCell
oForm(".cancel").Click
End Sub


I've changed it a bit to suit my needs. When i run this it displays
error msg "Object required" on line "Set oForm =
oIE.Document.forms(0)". I have references set to minrosoft internet
controls. I don't know what else to do. Please advise on this. Thanks.





All times are GMT +1. The time now is 03:34 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com