Our training courses

Other training resources

Our training venues

Why we are different

Details for tanny

tanny has participated in the following threads:

Added by tanny on 12 Jun 2018 at 18:13

I have been trying to follow your videos and extract data from an HTML file and I was able to do so on my system. BUT when I try to use  the same code/module to extract data from the html file from my Friend's system it shows me an "error 91: object variable or with block not set" at line 2 and sometime even at line 1. Basically it is not reading the html document on a different system. The HTMLButton1 and HTMLButton2 when tried in debug.print show nothing

Public Type MyType

     date As String
     protocol As String
     
End Type

sub main()

   Dim file As String
    Dim IE As New SHDocVw.InternetExplorerMedium
    Dim HTMLDoc As MSHTML.HTMLDocument
    Dim HTMLButton1
    Dim HTMLButton2

    file = "C:\temp\HTML\page1.html"
      
        IE.Visible = False
        IE.navigate file                              'line 1
        Do While IE.Busy = True
        Loop
        
        Set HTMLDoc = IE.Document
        Set HTMLButton1 = HTMLDoc.elementFromPoint(338, 462)
        Set HTMLButton2 = HTMLDoc.elementFromPoint(314, 490)
        
        array_objects(index).date = HTMLButton1.innerText                       'line2
        array_objects(index).protocol = HTMLButton2.innerText

IE.Quit
     Set IE = Nothing

end sub

Head office

Kingsmoor House

Railway Street

GLOSSOP

SK13 2AA

London

Landmark Offices

99 Bishopsgate

LONDON

EC2M 3XD

Manchester

Holiday Inn

25 Aytoun Street

MANCHESTER

M1 3AE

© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.

End of small page here
Please be aware that our website uses cookies!
I'm OK with this Tell me more ...