Results 1 to 6 of 6

Thread: VBA Excel and IE

Threaded View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Sep 2004
    Location
    Surrey, UK
    Posts
    163

    Resolved VBA Excel and IE

    Ok, should be a quick one. I'm struggling to do something that should be obvious. Must be a lack of cafeine or something. Anyway, any help greatly appreciated!

    Below is some simple code in Excel. If it finds a tab in IE that contains google.co.uk, it opens a new tab next to it and loads vbforums.com. My problem is I want the IE window and the new tab to become active on my desktop once its been created. Seems so simple yet I can do it....! ....help...

    Code:
        
    Dim w As InternetExplorer
    
        For Each w In CreateObject("shell.Application").Windows
            If InStr(1, w.LocationURL, "google.co.uk") > 0 Then
                    
                    w.Navigate "http://www.vbforums.com", , "_blank"
                    Exit For
            End If
        Next w
    Last edited by strobinson1; Sep 6th, 2012 at 08:51 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width