PDA

View Full Version : object variable or with block variable not set



sachin123sood
08-20-2004, 12:28 AM
I am fetching data from net using SHDocVw.InternetExplorer

and repeatedly calling the proc to refresh the data
but while fetching the data in the string using

Dim oIE As SHDocVw.InternetExplorer
dim spage as string

Set oIE = New SHDocVw.InternetExplorer
sPage = oIE.Document.body.InnerHTML

I am getting the error at line "sPage = oIE.Document.body.InnerHTML"

This is the error I am getting :

run time error '91'
object variable or with block variable not set.

how can i avoid the error or how to handle this error so that I can resume Processing and fetch the next set of data from the web .

Richie(UK)
08-20-2004, 12:53 AM
For reference, this query has also been posted here:

http://www.ozgrid.com/forum/showthread.php?t=22884&highlight=Dim+oIE

Zack Barresse
08-20-2004, 07:37 AM
If you set this as an Object, you must add 'Set' to the beginning of your statement ...


Set sPage = oIE.Document.body.InnerHTML


How does that work for you?