Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

WebBrowser, Document Object Model, error 91

VB6, XP, IE7 beta3

Code:
Dim HTML As HTMLDocument
Set HTML = IzoneBrowser.Document
HTML.All.Item("q").Value = "portfolioWatchList"

HTML.All.Item generates the compile error:

Run time error 91
Object variable or with block variable not set

RE: http://home.rochester.rr.com/lgssta...html#WEB_NEWWIN
does not mention any other 'Components' or 'References' . Before I added the above 3 lines, my application compiles and I could accessed the web site.

Question 1.) Why does this not compile?

----------------

At the point in the program where I inserted these line, the web site will have been completely loaded. However, the above reference always has the 3 lines of Question 1.) inside the following subroutine:

Code:
Private Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If (pDisp Is WebBrowser1.Application) Then

End Sub

I don't see how there is a requirement to place the DOM code inside of the DocumentComplete. It would complicate my code to do so.

Question 2.) Please tell me if there is that requirement or not.

"The solution is out there somewhere."

Thanks,
Winnie-the-Pough
[1292 byte] By [dmb-job] at [2007-11-11 10:27:17]
# 1 Re: WebBrowser, Document Object Model, error 91
My mistake.
I did not understand the syntax and thus the error is generated because 'q' does not exist in the HTML.
Winnie-the-Pough
dmb-job at 2007-11-11 23:34:23 >
# 2 Re: WebBrowser, Document Object Model, error 91
My mistake.
I did not understand the syntax and thus the error is generated because 'q' does not exist in the HTML.
This Post can be removed.
Winnie-the-Pough
dmb-job at 2007-11-11 23:35:32 >