我想使用VBA访问Internet Explorer。
Dim ie As InternetExplorer
Dim i As IHTMLDocument
Dim d As HTMLDocument
Set ie = New InternetExplorer
ie.Visible = True
ie.Navigate "www.google.com"
Set d = ie.Document
我想使用intellisense这就是为什么而不是去ie.document.get
我正在使用这种方法。
得到这样的错误:
答案 0 :(得分:0)
该问题与intellisense无关。您只需要等到导航完成并且IE准备就绪,然后才能访问文档:
Sub Test()
Dim ie As InternetExplorer
Dim i As IHTMLDocument
Dim d As HTMLDocument
Set ie = New InternetExplorer
With ie
.Visible = True
.Navigate "https://www.google.com"
Do While .ReadyState < READYSTATE_COMPLETE Or .Busy: DoEvents: Loop
Set d = .Document
End With
End Sub
另请查看this回答。