title: Passing object to Class method: Object doesn't support this property or method
body: <p>Hi i'm working in excel 2013 vba, I want to pass a worksheet object to a class function:</p>
  
  <p>'Class module Class1'</p>
  
  <pre><code>Sub receive(ByRef ws As Worksheet)
      msgbox ws.name
  End Sub
  </code></pre>
  
  <p>Calling the class method receive with:</p>
  
  <pre><code>Sub passToClass()
    Dim ws as Worksheet
    Set ws = ThisWorkbook.Worksheets("sheet1")
    Dim myClass As New Class1
    myClass.receive(ws) ' Run-time Error '438': Object doesn't support this property or method
  End Sub
  </code></pre>
  
  <p>A simple test that does work are two subroutines in the same module: </p>
  
  <pre><code>Sub pass()
     Dim ws as Worksheet
     Set ws = ThisWorkbook.Worksheets("sheet1")
     call receive(ws)
  End Sub
  
  Sub Receive(ByRef ws As Worksheet)
      msgbox ws.name
  End Sub
  </code></pre>
  
  <p>What am I missing conceptually?</p>
  
  <p>Thanks in advance!</p>