1
我想在使用VBA的网站上填写表单。如何在喜欢的组合框中使用VBA在Internet Explorer中的值
问题:问题是,在所述网页中的组合框被链接,例如,如果我选择在所述第一组合框的值手动然后它激活下一个(其否则灰色)。但是,当我尝试在下面的代码的最后一行中使用vba填充组合框中的值时,下一个组合框仍然呈灰色/不活动状态。请帮忙。
Sub newabc()
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")
ie.Visible = True
ie.navigate "URL"
While ie.Busy
DoEvents
Wend
ie.Document.getelementbyid("USER").Value = "username"
ie.Document.getelementbyid("PASSWORD").Value = "password"
ie.Document.all("Submit").Click
While ie.Busy
DoEvents
Wend
ie.navigate "tab"
While ie.Busy
DoEvents
Wend
ie.Document.all("new").Click
While ie.Busy
DoEvents
Wend
ie.Document.all("j_id0:frm:jobTrackerPageBlock0:startflds1:repeat5:1:inputField").Value = "Media Payables"
'problem occurs here as the next combo box stays inactive.
不知道网页的源代码真的很难回答。在分配.Value之后,可能会调用ie.Document.all(“j_id0:frm:jobTrackerPageBlock0:startflds1:repeat5:1:inputField”)。onchange()'可能会有所帮助。 – 2014-11-15 10:01:15