title: Set property of vba class with object reference
body: <p>I have a class module, named <code>Normal</code>, in VBA with the following code:</p>
  
  <pre><code>Private mLine As LineElement
  
  Public Property Get Line() As LineElement
      Line = mLine
  End Property
  
  Public Property Set Line(ByRef vLine As LineElement)
      mLine = vLine
  End Property
  </code></pre>
  
  <p>This class is used by the following code:</p>
  
  <pre><code>Sub Run
      Dim Line As LineElement
      Set Line = New LineElement
  
      Dim Norm As Normal
      Set Norm = New Normal
      Set Norm.Line = Line 'FAILS here with "Object Variable or With Block Variable not set"'
  End Sub
  </code></pre>
  
  <p>Also, if I change the code in the <code>Normal</code> class module to:</p>
  
  <pre><code>Private mLine As LineElement
  
  Public Property Get Line() As LineElement
      Line = mLine
  End Property
  
  Public Sub SetLine(ByRef vLine As LineElement) 'changed from property to sub'
      mLine = vLine
  End Property
  </code></pre>
  
  <p>and the failing line to </p>
  
  <pre><code>Norm.SetLine( Line )
  </code></pre>
  
  <p>I get an "Object does not support this property or method" error.  What exactly am I doing wrong in both of these cases?</p>