Test if Internet Explorer Object Exists

ExcelChampion

Well-known Member
Joined
Aug 12, 2005
Messages
976
Trying to test if an Internet Explorer window is already open. Basically, the macro I have first opend a new instance of IE and then does some stuff and then needs to loop back and use the existing window. However, I just can't seem to get it right. It keeps opening a new instance of IE or it does nothing depending on how I structure the boolean. Doing this a few hundred times is a problem.

FYI, ie is declared as a Public Object

Code:
Sub PIDQuery()
    Dim myRow As Variant
    Dim i As Integer
    Dim myID As Object, myPassword As Object, BidTypeCd As Object, PartNumOffr0EDrop As Object, overridelink As Object
    Dim x As String

    myRow = Evaluate("MATCH('Control Form'!B3,'Bid Database'!A:A,0)")

    If Not ie Is Nothing Then GoTo again

    Set ie = CreateObject("InternetExplorer.Application")

again:

    With ie

        .navigate "https://www.dibbs.bsm.dla.mil/RA/Quote/QuoteForm.asp?sn=" & WorksheetFunction.Substitute(Sheets("Bid Database").Range("G" & myRow).Value, "-", "") & "&TypeSrch=cq&selection=solicitation&sort=solicitation&scope=all&value=" & WorksheetFunction.Substitute(Sheets("Control Form").Range("G" & myRow).Value, "-", "")
        Do Until .readyState = 4: DoEvents: Loop
        Do While .Busy: DoEvents: Loop
        DoEvents
     'do some stuff...

     End With

End Macro
 
Last edited:

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Maybe this link is the kind of thing you are after:
http://www.mrexcel.com/forum/showthread.php?t=227669

I miss that "Im a Data Anlyst and have no idea what its all about" tag from your sig line.

Heya, Tom. Yes, I should put that tag back in my sig. Weren't you the one that "corrected" that guy? That guy was something else. Makes you wonder how some ppl get along in this world.

BTW, I did get this working. It was a matter of how the logic was structured.
 
Upvote 0

Forum statistics

Threads
1,214,819
Messages
6,121,727
Members
449,049
Latest member
MiguekHeka

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top