OpenOffice で簡単な Web スクレイピングをしようとしています (通常は Excel で作業していますが、Excel を持っていない同僚のために何かを移植しようとしています)。ただし、これと非常によく似たものを実行しようとすると、この BASIC ランタイム エラー 1 が表示され続けます。
関連するコードは次のとおりです。これを機能させるために何をすべきかわかりません。
Sub Macro1
Dim explorer As Object
Set explorer = CreateObject("InternetExplorer.Application")
explorer.Visible = True
explorer.navigate("www.yahoo.com")
Const READYSTATE_COMPLETE As Long = 4
Do While explorer.Busy Or explorer.readyState <> READYSTATE_COMPLETE
Loop
dim page as object
set page = explorer.Document
dim mailButton as object
set mailButton = page.GetElementByID("ybar-navigation-item-mail") 'this is the line the error occurs on
mailButton.Click
End Sub