title: how to pass class variables in vba function
body: <p>I want to pass my set of objects and variables to VBA function, make some changes to it and pass it back as a result. So I create a sample Class1: </p>
  
  <pre><code>Public pInfo As String
  </code></pre>
  
  <p>and sample function:</p>
  
  <pre><code>Public Function populate(someVar As Class1) As Class1
  
      populate.pInfo = someVar.pInfo &amp; " 1 "
  
  End Function
  </code></pre>
  
  <p>and tryed to pass it to my function populate:</p>
  
  <pre><code>Sub test()
  Dim v, w As Class1
  Set v = New Class1
  v.pInfo = "303"
  Set w = populate(v) ' ERROR here
  
  End Sub
  </code></pre>
  
  <p>results in compile error : byRef argument type mismatch. </p>
  
  <p>UPDATE. Thanks to your help it compiles now.</p>