title: Pass vba Dictionary
body: <p>New to vba. How to pass dictionary object to another function.</p>
  
  <pre><code>Sub aaa(dict As Object)
  Set dict = CreateObject("Scripting.Dictionary")
  ...
  process dict 
  End Sub
  
  Sub process(dict As Scripting.Dictionary)
      MsgBox dict.Count
  End Sub
  </code></pre>
  
  <p>gives a compile error:
  User defined type not defined</p>
  
  <hr>
  
  <p>Also,</p>
  
  <pre><code>Set dict = CreateObject("Scripting.Dictionary")
  </code></pre>
  
  <p>works, but</p>
  
  <pre><code>Dim dict As New Scripting.Dictionary 
  </code></pre>
  
  <p>gives, "User defined type not defined"</p>
  
  <p>I use excel 2010</p>