tiredofit
Well-known Member
- Joined
- Apr 11, 2013
- Messages
- 1,926
- Office Version
- 365
- 2019
- Platform
- Windows
We know there is limited inheritance in VBA and in order to use it, you would need to use the word with implements.
However, in my example below, is this an example of inheritance?
Class1:
Class2:
Standard Module:
However, in my example below, is this an example of inheritance?
Class1:
Code:
Private pabc As Integer
Public Property Let abc(ByVal vNewValue As Integer)
Dim c As Class2
Set c = New Class2
c.cde = 20
End Property
Class2:
Code:
Private pcde As Integer
Public Property Let cde(ByVal vNewValue As Integer)
pcde = vNewValue
End Property
Standard Module:
Code:
Sub Start()
Dim x As Class1
Set x = New Class1
x.abc = 10
End Sub