title: Invalid Use of property vba class
body: <p>I have the Student class in VBA (Excel) implemented as follows</p>
  
  <pre><code>Option Explicit
  
  Private name_ As String
  Private surname_ As String
  Private marks_ As New Collection
  
  
  Public Property Get getMean() As Single
  
      Dim sum As Double
      Dim mark As Double
      Dim count As Integer
  
      For Each mark In marks_
          sum = sum + mark
          count = count + 1
      Next mark
  
      getMean = sum / count
  
  End Property
  
  Public Property Let setName(name As String)
      name_ = name
  End Property
  
  Public Property Get getName() As String
      getName = name_
  End Property
  
  Public Property Let setSurname(surname As String)
      surname_ = surname
  End Property
  
  Public Property Get getSurname() As String
      getSurname = surname_
  End Property
  </code></pre>
  
  <p>Then I have a main sub where I write:</p>
  
  <pre><code>Dim stud1 As New Student
  
  stud1.setName "Andy"
  </code></pre>
  
  <p>I got a compile error on <code>stud1.setName "Andy"</code> : Invalid use of property. 
  I don't understand why. Any Idea, please?</p>