Check if Internet Explorer is already running

Spurious

Active Member
Joined
Dec 14, 2010
Messages
439
I got the following code:

Code:
Function QuelltextAuslesen(jURL As String) As String 
Dim IEApp As InternetExplorer 'Need a reference to Microsoft Internet Controls 
Dim HTMLDoc As HTMLDocument 'Need a reference to Microsoft HTML Object Library 

[...] 

Set IEApp = New InternetExplorer 
IEApp.Visible = False 'Some things don't work unless it's visible 
IEApp.navigate jURL 
'We need to wait for the website to complete loading 
Do 
    DoEvents 
Loop Until IEApp.readyState = READYSTATE_COMPLETE 

Set HTMLDoc = IEApp.Document 
QuelltextAuslesen = HTMLDoc.body.innerHTML 
IEApp.Quit 
Set IEApp = Nothing 
End Function

If I use visible = true, several instances of IE can run, but since I want it to be invisible, I need a way to check if IE is already running.
What's my play?

Thanks in advance!
 

Excel Facts

Return population for a City
If you have a list of cities in A2:A100, use Data, Geography. Then =A2.Population and copy down.
Hi

Why do you need to check if IE is running?

You have created a new instance of IE in the function which is not visible.

Perhaps you need this to determine when the web page is loaded -

Code:
    Do Until ieAPP.Document.ReadyState = "complete"
        DoEvents
    Loop

hth
 
Last edited:
Upvote 0
Hi

I just checked on a similar process -

1, I commented out the "ie.Visible = True" statement rather than say "ie.Visible = False". I don't get added instances of ie.

2. The piece of code in my last post didn't execute, probably because the whole page had loaded anyway.

Apart from that what doesn't work?
 
Upvote 0

Forum statistics

Threads
1,224,560
Messages
6,179,519
Members
452,921
Latest member
BBQKING

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