我想知道何时在 Office VBA 中处理属性。
考虑这个类模块(MyClass):
Public Property Get ExpensiveProperty() As Variant
'Some resource expensive procedure here
End Property
Public Property Get SomeProperty() As Variant
'Something easy
End Property
这个模块:
Sub test()
Dim MC As MyClass
Set MC = New MyClass
Dim Smth As Variant
Smth = MC.SomeProperty
End Sub
是否MC.ExpensiveProperty按test()程序处理?(假设没有参考ExpensivePropertyin SomeProperty)