|
-
Aug 14th, 2000, 06:06 AM
#1
Thread Starter
New Member
Hi,
I am getting an error on the last line it gives a runtime error "91" with the message object variable or with block variable not set. I get this with just a form and the webbrowser control. And following code at form load:
WebBrowser1.Navigate2 "about:blank"
Dim strHTML As String
strHTML = "Your HMTL Code Here"
WebBrowser1.Document.Body.Innerhtml = strHTML
This happends on 2 different computers one with nt4 and the other with win2000. Vb version is 6. One with sp3 and the other with no sp. Both using internet explorer 5.
Would be great if somebody would have an answer to this.
Greatone
-
Aug 14th, 2000, 06:31 AM
#2
Addicted Member
Hi,
Whats happening is that your code is trying to write to the document before it has actually loaded. Try putting the following code in to make sure it is loaded before you write to it:
[code]
Private Sub form_load()
WebBrowser1.Navigate2 "about:blank"
Dim strHTML As String
strHTML = "Your HMTL Code Here"
Do Until WebBrowser1.ReadyState = READYSTATE_COMPLETE
DoEvents
Loop
WebBrowser1.Document.Body.innerhtml = strHTML
End Sub
Hope this helps
Shaun
-
Aug 14th, 2000, 06:34 AM
#3
Or you can just move the code (that you have after the call to Navigate2 method) to the NavigateComplete2 event.
-
Aug 14th, 2000, 07:04 AM
#4
Thread Starter
New Member
Thanks
Hi S@NSIS,
It works!
Thank you very much. I got the code from an other place. It was in a tutorial even without your line in it. This works great!
Greetings
Greatone
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|