Bonjour
j'ai un p'tit pb tout bête:
J'ai créé un module de classe TT
Private zt1 As Integer
Private zt2 As Integer
Public Property Let t1(ByVal valeur As Integer)
zt1 = valeur
End Property
Public Property Let t2(ByVal valeur As Integer)
zt2 = valeur
End Property
Public Property Get t1() As Integer
t1 = zt1
End Property
Public Property Get t2() As Integer
t2 = zt2
End Property
Public Property Get newT() As TT
Dim ta As New TT
With ta
.t1 = zt1 * 2
.t2 = zt2 * 2
End With
newT = ta
End Property
Puis j'appelle les éléments du module de classe dans un module Excel classique
Sub test()
Dim at1 As New TT
at1.t1 = 1
at1.t2 = 2
Debug.Print at1.t1: Debug.Print at1.t2
Dim at2 As New TT
at2 = at1.newT
End Sub
ma fonction get newT ne fonctionne pas (ligne newT=ta) avec le msg: variable objet ou variable de bloc with non définie
Avez-vous une idée ?
Merci