0

hi

i used the following code to read data from web.

this is my code

Private Sub Command1_Click()
Dim Text As Variant
WebBrowser1.Navigate ("www.google.co.in")
Text = WebBrowser1.Document.Body.Innertext
MsgBox Text

For i = 1 To 1000
If Mid$(Text, i, 8) = "google" Then
MsgBox ("String Found")
End If
Next i
End Sub


when i execute this code ,i receive an error message
runtime error :'91'
"object variable or with block variable not set"

the error appears in the underlined statement.
also i use IE 7.will there be any problem due to this.

pls help me out
thank u

2
Contributors
1
Reply
2
Views
8 Years
Discussion Span
Last Post by bushman_222
0

hi

i used the following code to read data from web.

this is my code

Private Sub Command1_Click()
Dim Text As Variant
WebBrowser1.Navigate ("www.google.co.in")
Text = WebBrowser1.Document.Body.Innertext
MsgBox Text

For i = 1 To 1000
If Mid$(Text, i, 8) = "google" Then
MsgBox ("String Found")
End If
Next i
End Sub


when i execute this code ,i receive an error message
runtime error :'91'
"object variable or with block variable not set"

the error appears in the underlined statement.
also i use IE 7.will there be any problem due to this.

pls help me out
thank u

I've ran your code and it worked fine for me.

I am using IE 6.

Try unistall IE 7 to IE 6,

I've heard that people have had problems with IE7 and the web browser. there are some tutorials on the net to fix it with IE7, first I'll see if IE 7 is the problem

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.