title: How to pass a dynamic array into a VBA object. Compile error: Invalid use of property
body: <p>I'm trying to pass an array into a custom class for storage and further use within that object. The class object has the following definition:</p>
  
  <pre><code>' Class Name: MBRMCurves
  Implements ICurves
  
  Private m_lInterpDates() As Long
  
  Public Property Get InterpDates() As Long()
  
      InterpDates = m_lInterpDates
  
  End Property
  
  Public Property Let InterpDates(lInterpDates() As Long)
  
      m_lInterpDates = lInterpDates
  
  End Property
  </code></pre>
  
  <p>The module that calls this code looks like this:</p>
  
  <pre><code>Dim objResult     As New MBRMCurves
  
      'Store the forward prices
      Dim fx_fwd()      As Double
  
      'Store the interpolation dates
      Dim int_dates()   As Long
  
      'initially there are no people
      Dim NumberTenors  As Integer
      NumberTenors = 0
  
      Dim cell          As range
  
      ' Create ranges of Dates
      Dim range     As range
      Dim range_topcell As range
  
      ' TODO Pri1 Create the Curves Obj
      With Worksheets("test")
  
          ' Populate the dates of the FWD rates.
          Set range_topcell = .range("B5")
  Debug.Print range_topcell.Value
          Set range = .range(range_topcell, range_topcell.End(xlDown))
  Debug.Print range.Count
  
          ' Add more columns to the FWD array
          ReDim fx_fwd(0 To range.Count - 1, 0 To 3)
          ReDim int_dates(0 To range.Count - 1)
  
          ' Set the counter
          NumberTenors = 0
  
          ' Populate the dates of the FWD rates into the first column of the dates array.
          For Each cell In range
              NumberTenors = NumberTenors + 1
              int_dates(NumberTenors - 1) = cell.Value
          Next cell
  
          ' Add interpolation dates to Curves object
          objResult.InterpDates int_dates
  </code></pre>
  
  <p>The last line in the above code is giving me the compile error:  Invalid use of property.</p>
  
  <p>I believe that the syntax of me Let function is correct, but I might be missing a more subtly nuanced oversight.</p>
  
  <p>Can anyone see what I'm doing wrong? I'm working with Excel 2003 and VBA 6.5 on Windows XP.</p>
  
  <p>Any suggestions would be greatly appreciated.</p>
  
  <p>Thanks,</p>
  
  <p>Christos</p>