title: excel 2003 vba.. writing arraylist
body: <p>I am trying to create <code>ArrayList</code> of Class like in Java, in Visual Basic Excel 2003.</p>
  
  <p>Java</p>
  
  <pre><code>List&lt;Employee&gt; employees = new ArrayList&lt;Employee&gt;();
  Employee employee = new Employee();
  employee.setName("tom");
  employees.add(employee);
  </code></pre>
  
  <p>VB</p>
  
  <pre><code>Dim resultList As New Collection    
  Dim Manager As Employee
  Manager.Name = "df"    
  resultList.Add ("rr") 'correct
  resultList.Add (Manager) 'error
  </code></pre>
  
  <p>But this gives the following error:</p>
  
  <blockquote>
    <p>only user-define types defined in public object modules can be coerced
    to or from a variant or passed to late-bound functions</p>
  </blockquote>