# vba view open internet explorer window



## akramer08 (Jul 29, 2013)

I am looking for a macro that will bring a currently open internet explorer window into view. And if the site is not currently open, open it.

http://www-acg.bru-hub.dhl.com/track/app


----------



## akramer08 (Jul 30, 2013)

Any ideas?


----------



## ZVI (Jul 30, 2013)

What is your link in post #1 for? It is not working.
See this thread: VBA Macro For Already Open IE Window


----------



## akramer08 (Jul 31, 2013)

Thanks. I used the below code and it works pretty well. The only problem is it loads the page on the first tab I have in the already open explorer window. Is there and way to see if a website with an address is already open and if it is just use that window? If not, create a new window in that current explorer?


----------



## akramer08 (Jul 31, 2013)

Forgot to attach the code I used.



```
Sub TrackShipment(control As IRibbonControl)


Dim IE As Object
With CreateObject("Shell.Application").Windows
    If .Count > 0 Then
' Get IE
        Set IE = .Item(0) '.Item(.Count + 1)
    Else
' Create IE
        Set IE = CreateObject("InternetExplorer.Application")
        IE.Visible = True
    End If
IE.Navigate "whateverwebpage"
Set IE = Nothing
End With


End Sub
```


----------



## ZVI (Jul 31, 2013)

In the link I've provided see the code of post #6


----------



## akramer08 (Aug 2, 2013)

Unfortunately, Im a novice when it comes to incorporating internet explorer with excel vba. Im not sure what part I would change to the web page I need or an that.


----------



## ZVI (Aug 2, 2013)

It’s simple:
1. In the link provided copy the code of function NavigateTo() and paste it to your code module.
2. In the same module use it like this:

```
Sub Test()
  NavigateTo "whateverwebpage" ' Replace "whateverwebpage" by URL
End Sub
```


----------

