title: VBA Adding a class to a collection
body: <p>I have a class module called Holding. In it are several public variables. My code is this:</p>
  
  <pre><code>Dim holdings as Collection
  Dim h as Holding
  
  Set holdings = new Collection
  
  For i = 1 to last
      Set h = new Holding
  
      h.x = y
      '... etc
  
      holdings.Add(h)
  Next i
  </code></pre>
  
  <p>This gives me error "object doesnt support this property or method" on the <code>holdings.Add(h)</code> line, but everywhere I look, it gives this exact example of how to achieve this. What am I missing?</p>