How do you reference the HTMLSelect object from VBA?
I am trying to reference the HTMLSelect object in VBA. Assuming I have a form on the html page and a select control named LB. I can't figure out why I get an error message using the code below.
Dim ieApp As InternetExplorer
Dim ieSelect As HTMLSelect
Dim iePage as HTMLDocument
Set ieApp = New Intern开发者_运维问答etExplorer
ieApp.Visible = True
ieApp.navigate "C:\formA.html"
Do Until ieApp.readyState = READYSTATE_COMPLETE
Loop
Application.Wait (Now() + TimeValue("00:00:05"))
Set iePage = ieApp.document
Set ieSelect = iePage.forms(0).Item("LB")
Hm, not sure, but have you the runat="server" on the in formA.html?
精彩评论