別のオブジェクトを実装するクラスがあります。実装されたオブジェクトの各プロパティにプロパティ関数を設定しましたが、「プロパティの無効な使用」エラーが発生し続けます。これが私のコードです:
テスト サブ:
Sub tst()
Dim a As Derived
Set a = New Derived
a.Base_name = "ALGO" 'Error happens when this executes
End Sub
派生クラス モジュール:
Option Explicit
Implements Base
Private sec As Base
Private Sub Class_Initialize()
Set sec = New Base
End Sub
Public Property Get Base_name() As String
Call sec.name
End Property
Public Property Let Base_name(value As String)
Call sec.name(value) 'Error happens here
End Property
基本クラス モジュール:
Private pname As String
Public Property Get name() As String
name = pname
End Property
Public Property Let name(value As String)
pname = value
End Property