このコードはIDEでうまく機能しますが、exeファイルに作成して同じマシンで実行すると、最後の行で毎回クラッシュします。なぜですか?
PageFinished = False
Cancelling = False
OKToUnload = False
WebBrowser.Navigate ("https://www.example.com/index.jsp")
Do While PageFinished = False 'set to true in document complete event
DoEvents
If Cancelling = True Then
OKToUnload = True
GoTo Endline
End If
Loop
PageFinished = False
WebBrowser.Document.All("UserId").Value = txtNumber.Text 'error here