title: What's the easiest way to list out the open windows in Excel VBA?
body: <p>I know I could've been searching on Google, but I've been rusty at it to the point where I'm not sure what terms I should search for. It would help to hear your suggestions here.</p>
  
  <p>Example:</p>
  
  <pre><code>Sub Macro1()
  '
  ' Macro1 Macro
  '
  
  '
      Windows("FL_bounces.csv").Activate
      Windows("auto_dealers_FL.csv").Activate
      Windows("FL_bounces.csv").Activate
      Windows("auto_dealers_FL.csv").Activate
  End Sub
  </code></pre>
  
  <p>Except where I don't know the names of the windows open.</p>
  
  <p>Edit #2:</p>
  
  <pre><code>Sub Macro1()
  '
  ' Macro1 Macro
  '
  
  '
      Dim wn, contacts, report As Excel.Window
      Dim windows(1 To 100) As Excel.Window
      Dim i As Integer
  
      i = 1
      For Each wn In Application.windows
          windows(i) = wn
          i = i + 1
      Next wn
  
      If IsEmailValid(windows(1).Cells(1, 1)) = True Then
          report = windows(1)
          contacts = windows(2)
      Else
          contacts = windows(1)
          report = windows(2)
      End If
  
  
  End Sub
  </code></pre>
  
  <p>What do you see wrong in this modification?</p>