【发布时间】:2017-04-12 21:19:00
【问题描述】:
Sub AutoLoadAccounts()
Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")
IE.Navigate "https://www.urlhere.com/admin/accounts/create"
IE.Visible = True
While IE.busy
DoEvents
Wend
IE.Document.All("title").Value = ThisWorkbook.Sheets("sheet1").Range("a1")
IE.Document.All("names").Value = ThisWorkbook.Sheets("sheet1").Range("b1")
IE.Document.All("floor").Value = 30
IE.Document.getElementById("status").selectedindex = 1
IE.Document.getElementById("email_state").selectedindex = 1
IE.Document.All("id").Value = ThisWorkbook.Sheets("sheet1").Range("c1")
IE.Document.All("years").Value = ThisWorkbook.Sheets("sheet1").Range("d1")
IE.Document.All("submit").Click
End Sub
我使用上面的代码来填充一个网络表单并提交它。我有大约 150 行数据,范围从 A1:D1。我正在尝试找到一种方法,在提交表单后逐个循环遍历行,直到它到达末尾。
所以本质上它将从第一行开始并填充 A1:D1 中的字段,然后在完成后进入下一行并为 A2:D2 执行相同的操作。等等
【问题讨论】: