Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default FollowHyperlinks opening multiple browser windows


Hi all.

Here is what I came up with after some serious web searching and a lo
of trial and error.

I originally thought that I could use th
GetObject("","InternetExplorer.Application" to control an open I
window, but for some very technical reasons that I found in the M
Knowledge Base ariticles, you can't do that.... However
CreateObject("InternetExplorer.Application") works great if you want t
spawn a new IE window every time you execute your code.

So I had to add a reference in my VBA to the "Microsoft Interne
Controls", which pointed to the shdocvw.dll file.

I then used the code below to look at the long file name for ever
shell windows that is running to see if one of the shell windows is IE
If one of the shell windows is IE, I set a custom object to tha
window, and then Navigate to the appropirate URL. If there are no I
windows that are open, the windows is very happy to open a new one t
the approripriate URL.

Sub GoToEPMExpress()
Dim sURL As String
Dim bIERunning As Boolean

Set objSW = New SHDocVw.ShellWindows
sURL
"http://myintranetapp:8181/EPM/EPMHome.jsp?businessRequirementID=14"

For Each objIE In objSW
If InStr(1, UCase(objIE.FullName), "IEXPLORE") Then
Set objIE = objSW.Item
bIERunning = True
Exit For
End If
Next objIE

If bIERunning Then
objIE.Navigate sURL
Else
Set IE = CreateObject("InternetExplorer.Application")
With IE
If Len(sURL) Then .Navigate sURL Else .GoHome
Do Until Not .Busy
DoEvents
Loop
.Visible = True
End With
Set IE = Nothing
End If
End Sub


I hope this helps if you're having the same problem with multiple I
windows being created from an Excel app when using the FollowHyperlin
method.

Cheers,
Eric :

--
EricIsDeliriou
-----------------------------------------------------------------------
EricIsDeliriou5's Profile: http://www.excelforum.com/member.php...fo&userid=1562
View this thread: http://www.excelforum.com/showthread.php?threadid=27168

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Opening multiple Excel files from IE browser does not open in new instance of Excel - BUG? Robert Aldwinckle Setting up and Configuration of Excel 1 November 11th 09 05:13 PM
Multiple instances of Excel opening when using Windows Explorer cmanssur Excel Discussion (Misc queries) 1 June 20th 07 04:07 PM
Windows browser Parent/Child structure ERK New Users to Excel 2 December 3rd 06 12:44 AM
opening multiple windows at once? Chris New Users to Excel 2 November 15th 05 03:59 PM
FollowHyperlinks opening multiple browser windows EricIsDeliriou5 Excel Programming 1 October 22nd 04 11:14 PM


All times are GMT +1. The time now is 08:23 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"