title: Trying to loop through Workbooks.Name
body: <p>I am trying to loop through workbook-names which opens automatically, to close them, without saving them.
  This is how it works without a loop:</p>
  
  <pre><code>On Error Resume Next
  ActiveWorkbook.Sheets.Copy
  ActiveWorkbook.SaveAs Filename:=Path &amp; Range("C2").Value &amp; "_Plan.xlsx", FileFormat:=51
  
  
  If Err.Number = 1004 Then
      MsgBox "Speichervorgang wurde beendet."
      Workbooks("Mappe1").Close SaveChanges:=False
      Workbooks("Mappe2").Close SaveChanges:=False
      Workbooks("Mappe3").Close SaveChanges:=False
      Workbooks("Mappe4").Close SaveChanges:=False
      Workbooks("Mappe5").Close SaveChanges:=False
      Workbooks("Mappe6").Close SaveChanges:=False
      Workbooks("Mappe7").Close SaveChanges:=False
      ...
  Else
  ...
  End If
  </code></pre>
  
  <p>What I tried:</p>
  
  <pre><code>Dim counter As Integer
  Dim Mappenname As String
  
  On Error Resume Next
  ActiveWorkbook.Sheets.Copy
  ActiveWorkbook.SaveAs Filename:=Path &amp; Range("C2").Value &amp; "_Plan.xlsx", FileFormat:=51
  
  
  If Err.Number = 1004 Then
      MsgBox "Speichervorgang wurde beendet."
  
      counter = 0
      Do While counter = 100
          Mappenname = "Mappe" &amp; counter
          If Workbooks(Mappenname).Open = True Then
              ActiveWorkbook.Close SaveChanges:=False
              Exit Do
          End If
          counter = counter + 1
      Loop
  Else
  ...
  End If
  </code></pre>
  
  <p>With my Loop, nothing happens...</p>