Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/vba/17.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Excel 如何使用vba将值放入internet explorer中的相似组合框中_Excel_Vba_Internet Explorer_Combobox - Fatal编程技术网

Excel 如何使用vba将值放入internet explorer中的相似组合框中

Excel 如何使用vba将值放入internet explorer中的相似组合框中,excel,vba,internet-explorer,combobox,Excel,Vba,Internet Explorer,Combobox,我正在尝试使用VBA在网站上填写表格 问题:问题是,在网页中,组合框是链接的,例如,如果我在第一个组合框中手动选择一个值,那么它会激活下一个组合框(否则会变灰)。但是,当我尝试在下面代码的最后一行中使用vba填充组合框中的值时,下一个组合框仍然灰显/不活动。请帮忙 Sub newabc() Dim ie As Object Set ie = CreateObject("internetexplorer.application") ie.Visible = True ie.navigate

我正在尝试使用VBA在网站上填写表格

问题:问题是,在网页中,组合框是链接的,例如,如果我在第一个组合框中手动选择一个值,那么它会激活下一个组合框(否则会变灰)。但是,当我尝试在下面代码的最后一行中使用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.
完美的

ie.Document.all(“elementID‌​").onchange成功了。
谢谢你,我已经想了很久了。

谢谢Axel Richter。

在不知道网页的源代码的情况下,很难回答。可能会调用
ie.Document.all(“j_id0:frm:jobTrackerPageBlock0:startflds1:repeat5:1:inputField”)。onchange()
在指定.Value之后可能会有所帮助。