title: VBA loop through objects via FOR EACH
body: <p>I have created a class named category, which has 3 attributes.
  In my main class I am setting up 10 instances of the type category.
  With an init-function I initialize these objects, so that I can use them.
  Now I want to loop through these objects.
  I have searched for 2 hours, and the only thing I found is that the only solution is to create a collection of these objects.
  You can see my code sample below:</p>
  
  <pre><code>Dim Kat1 As New category
  Dim Kat2 As New category
  Dim Kat3 As New category
  Dim Kat4 As New category
  Dim Kat5 As New category
  Dim Kat6 As New category
  Dim Kat7 As New category
  Dim Kat8 As New category
  Dim Kat9 As New category
  Dim Kat10 As New category
  
  Dim col As New Collection
  
  Kat1.init "Kat1", 14, 17
  Kat2.init "Kat2", 18, 21
  Kat3.init "Kat3", 22, 25
  Kat4.init "Kat4", 26, 29
  Kat5.init "Kat5", 30, 33
  Kat6.init "Kat6", 34, 37
  Kat7.init "Kat7", 38, 41
  Kat8.init "Kat8", 42, 45
  Kat9.init "Kat9", 46, 49
  Kat10.init "Kat10", 50, 54
  
  col.Add Kat1
  col.Add Kat2
  col.Add Kat3
  col.Add Kat4
  col.Add Kat5
  col.Add Kat6
  col.Add Kat7
  col.Add Kat8
  col.Add Kat9
  col.Add Kat10
  
  
  For Each col.Item In col
     MsgBox (&lt;name of the object&gt;)
  Next col.Item
  </code></pre>
  
  <p>The last part doesn't seem to work, he stops at col.item with the error: "Argument is not optional".</p>
  
  <p>What have I done wrong?</p>