Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2007 -> IE 7 with VBA

Status
Not open for further replies.

Engywook

Technical User
Apr 19, 2007
9
US
Most of what I can find online with this seems to presuppose that I'm using IE6, an older version of Excel, or in most cases both.

I need Excel to be able to look for and address multiple windows, or tabs, in Internet Explorer. The basic syntax - for older builds of these two apps, I think, is something like this:

Code:
'SHDocVw is not recognized
Dim objIE As SHDocVw.InternetExplorer
Set objSW = New SHDocVw.ShellWindows
For Each objIE In objSW
Debug.Print "found one window"
'of course we want to do much more than this, but since we cant even get this far...
Exit For

This, I'm guessing, isn't right for IE7, but I'm not having much luck finding out what is. And even if it were, I would need to check on Microsoft Internet Controls reference under tools... which is not available in Excel 2007.

Anybody got some code, or a link, that can get me started?
 
A starting point:
Code:
Dim objShell, objWindows, objWindow, strMsg
Set objShell = CreateObject("Shell.Application")
Set objWindows = objShell.Windows
For Each objWindow In objWindows
  strMsg = strMsg & vbCrLf & objWindow.LocationURL
Next
MsgBox "Active URLs" & strMsg

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top