tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,926
- Office Version
- 365
- 2019
- Platform
- Windows
In the code below, why am I getting a Type mismatch error on this line?
Standard Module:
ClsRectangle:
Thanks
Rich (BB code):
a = rect.AreaItem(l, w)
Standard Module:
Rich (BB code):
Option Explicit
Sub Start()
Dim l As Double
Dim w As Double
Dim rect As New clsRectangle
l = 10
w = 20
rect.Area = l * w
Dim a As Double
a = rect.AreaItem(l, w)
End Sub
ClsRectangle:
Rich (BB code):
Option Explicit
Private dblA As Variant
Public Property Let Area(ar As Variant)
dblA = ar
End Property
Public Property Get AreaItem(lngth As Double, wdth As Double) As Variant
AreaItem = dblA(lngth, wdth)
End Property
Thanks
Last edited: