0
我已經很難處理錯誤438.我試圖將薪水屬性保存到集合中的每個員工。運行時錯誤'438':對象不支持此屬性或方法vba
Public Sub Click()
Dim employee As Collection
Set employee = New Collection
Dim n As Integer
Dim i As Integer
Dim E1 As Variant
Dim j As Integer
n = 528
Dim t As String
For i = 3 To n
t = "T" + CStr(i)
Set E1 = New clsEmployee
E1.salary = Sheets("A").Range(t).Value
Next i
End sub
這裏沒有任何代碼可以將任何東西添加到'員工'集合 – barrowc
'clsEmployee' *是否有'salary'屬性?它是公開的嗎? – Comintern
@barrowc我將此工資的價值從excel中分配給患者:E1.salary = Sheets(「A」)。Range(t).Value。 – Zapata