1

I have tried to modify on this sample code given to me by ron

Sub test()

Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")

my_url = "http://www.google.com"

With IE
    .Visible = True
    .navigate my_url
    .Top = 50
    .Left = 530
    .Height = 400
    .Width = 400

Do Until Not IE.Busy And IE.readyState = 4
    DoEvents
Loop

End With

' Find the desired url and click
Set Results = IE.document.getElementsByTagName("a")
For Each itm In Results
    If itm.outerhtml = "B.A.C. VII" Then
        itm.Click

        Do Until Not IE.Busy And IE.readyState = 4
            DoEvents
        Loop
        Exit For
    End If
Next
End Sub

Now i am not a fan of late binding so i am trying to modify the first two statements from

Dim IE As Object
Set IE = CreateObject("InternetExplorer.Application")

and replace them with

Dim IE As InternetExplorer.Application
Set IE = New InternetExplorer.Application

However this doesn't work on my code even if i have the Microsoft Internet Controls and the the Microsoft HTML Object Library activated on references as you can see in the picture below.

WHY THAT?

enter image description here

Dear mehow

I have thought of that but it gives me error just look

enter image description here

1 Answer 1

2
Dim ie As InternetExplorer
Set ie = new InternetExplorer

as InternetExplorer is the class name

enter image description here

Sign up to request clarification or add additional context in comments.

3 Comments

Dear @mehow i have tried that but let me show you in my re-edited question what it happened
@ExoticBirdsMerchant right so Set ie = new InternetExplorer
ohhhhhh got dammit i must hit my head with a hammer of something!

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.