title: VBA code to interact with specific IE window that is already open
body: <p>I am having trouble finding out how to get excel VBA to interact with a specific IE Window that is already open. </p>
  
  <p>Here my process:</p>
  
  <p>I open IE, navigate to the website, enter my username and pw, click log in. A new IE window opens that I use to enter member numbers and search for membership info. </p>
  
  <p>I am trying to create a VBA script that will interact with the IE window that opens after I successfully log in (to begin to automate some of the more mundane tasks). I have seen tons of tutorials online about how to have VBA open a new IE window, and then interact with it. However, I am really struggling to find info about how to select a specific already open IE window and interact with it. </p>
  
  <p>I have tried this as a quick test to see if I could select the correct IE window as an object that I can interact with. </p>
  
  <pre><code>Sub getIE()
  Dim sh As Object, oWin As Object, IE As Object
  
  Set sh = CreateObject("Shell.Application")
  
  For Each oWin In sh.Windows
      If TypeName(oWin.document) = "HTMLDocument" Then
          Set IE = oWin
          Exit For
      End If
  Next
  
  MsgBox IE.document.URL
  
  End Sub
  </code></pre>
  
  <p>The message box appears and shows the URL for initial IE window, but I don't know how to get it to select the IE window that I typically use to actually get member info. </p>
  
  <p>I took several technical classes years ago when I was in school, but has been a while since I have flexed any tech muscles. Any help would be greatly appreciated! </p>