有誰知道爲什麼這個ExplorerButton.Click
在運行時返回424對象引用錯誤? HTML模塊正確導入到能夠閱讀HTML相關命令:IE.document.all返回null元素vba
Private Sub Generate_Click()
Dim IE As New InternetExplorer
Dim ExplorerInput As HTMLInputElement
Dim ExplorerButton As HTMLInputElement
'Loading Page
IE.navigate "https://www.earthpoint.us/ExcelToKml.aspx"
'Show Window
IE.Visible = True
'Wait for loade
WaitIE IE
'Select document
Set IEDoc = IE.document
'Select Button
Set ExplorerButton = IEDoc.all.Item("FileUpload1")
'Click button
ExplorerButton.Click --> ERROR 424
End Sub
Sub WaitIE(IE As InternetExplorer)
'Loop until load
Do Until IE.readyState = READYSTATE_COMPLETE
DoEvents
Loop
End Sub
我指出錯誤 - > ERROR 424我一定是錯過引用的頁面......當我擡頭看教程一樣這一個http://qwazerty.developpez.com/tutoriels/vba/ie-et-vba-excel/,這真的很好地引起了,這是參考如何被支持,它似乎爲他(和他在我提到的頁面上)爲他工作。所以我想在定義按鈕元素時我必須省略一些東西。任何幫助非常感謝!
謝謝! D.
非常感謝你!無法直接訪問該項目,但通過iframe,這確實有效。 – Diveye