Consulting

Results 1 to 3 of 3

Thread: object variable or with block variable not set

  1. #1

    object variable or with block variable not set

    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 .

  2. #2
    VBAX Contributor Richie(UK)'s Avatar
    Joined
    May 2004
    Location
    UK
    Posts
    188
    Location

    Cross-posting

    For reference, this query has also been posted here:

    http://www.ozgrid.com/forum/showthre...hlight=Dim+oIE

  3. #3
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •