PC Review


Reply
Thread Tools Rate Thread

Check for instance of Internet Explorer

 
 
BBert
Guest
Posts: n/a
 
      26th Jan 2007
Hello Excel experts,

Couple of questions about Internet Explorer and Excel.
Whats the vba code to check if IE is running and if so, how many browser
windows are open? I want to close all windows but one. If Internet
Explorer is not running whats the code to open IE?

It would be very nice when i could read a page and bring some info from
the current browser window to excel. I know that i can do that by using
an web query but that's so time consuming. Are there alternatives?

Suppose i want the info from page:
http://www.allmusic.com/cg/amg.dll?p...0:gso20r8aq48n
Can i get that without using a webquery?

Thanks in advance.
--
With Kind Regards,
BBert

April 20, 1986
Celtics (135) - Bulls (131)
Larry Bird: "God disguised as Michael Jordan"
 
Reply With Quote
 
 
 
 
merjet
Guest
Posts: n/a
 
      26th Jan 2007
There is some code here to check if IE is running.

http://groups.google.com/group/micro...23a23b0ad2b9cd

You could probably modify to find how many IEs are running. I don't
know how to close them.

The following will get you to a webpage. I don't know how to extract
what you want.
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate "put url here"

Hth,
Merjet

 
Reply With Quote
 
BBert
Guest
Posts: n/a
 
      27th Jan 2007
On 26 Jan 2007 12:06:43 -0800, merjet wrote...

> The following will get you to a webpage. I don't know how to extract
> what you want.
> Set ie = CreateObject("InternetExplorer.Application")
> ie.Visible = True
> ie.Navigate "put url here"


OK thanks for the hint. It pushed me to the right direction. I managed
to put the following together and it worked.

******************************
Sub Open_IE()

Dim intCount, objExplorer, objShell, objShellWindows, objW, strUrl
strUrl = "http://www.amazon.com"
intCount = 0
'Create instance of IE
Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Visible = 1

Set objShell = CreateObject("Shell.Application")
Set objShellWindows = objShell.Windows

'Check for more browser windows
For Each objW In objShellWindows
If objW.FullName = "C:\Program Files\Internet Explorer
\iexplore.exe" Then intCount = intCount + 1
Next
' We want just one
If intCount > 0 Then
For Each objW In objShellWindows
If objW.FullName = "C:\Program Files\Internet Explorer
\iexplore.exe" And intCount > 1 Then
objW.Quit
intCount = intCount - 1
End If
Next
End If
objExplorer.Toolbar = 1
objExplorer.StatusBar = 1
objExplorer.MenuBar = 1
objExplorer.Width = 900
objExplorer.Height = 600
objExplorer.Left = 0
objExplorer.Top = 0
'go to Amazon and pick up the correct page
objExplorer.Navigate strUrl
End Sub


******************************
--
With Kind Regards,
BBert

April 20, 1986
Celtics (135) - Bulls (131)
Larry Bird: "God disguised as Michael Jordan"
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Invoking Javascript Functions from an Instance of Internet Explorer Matthew Lock Microsoft C# .NET 3 27th Jun 2007 04:42 AM
internet explorer instance =?Utf-8?B?TWFub2o=?= Microsoft Excel Misc 0 1st Feb 2006 09:56 AM
Single Instance of Internet Explorer =?Utf-8?B?TWljaGFlbCBNYXJ0aW4=?= Windows XP Internet Explorer 3 26th Dec 2005 06:32 PM
JPG's open in new instance of Internet Explorer Ophidian Windows XP Internet Explorer 5 2nd Oct 2004 01:57 AM
Opening More then one instance if Internet Explorer Chris Tarpey Windows XP General 6 29th Nov 2003 01:58 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:34 AM.