vba 嵌套类示例

t1:

自定义类

t2

Private m_t1 As t1
Public Property Get t1() 
    Set t1 = m_t1
End Property
Public Property Set t1(value As t1)
    Set m_t1 = value
End Property

Private Sub Class_Initialize()
  Set m_t1 = New t1
End Sub

其中 红色的“set” 千万不能忘了,因为t1示对象

你可能感兴趣的:(Class,VBA)