代码在这里,你会在每个语句的第一行得到一个运行时错误“424”对象
Public Sub test()
Dim a As clsTest
Dim dic As Dictionary
Dim tmpObj As clsTest
Set dic = New Dictionary
Set a = New clsTest
dic.Add "1", a
dic.Add "2", New clsTest
dic.Add "3", New clsTest
For Each tmpObj In dic.Items '--<< error: Run-time error '424' Object required
Debug.Print tmpObj.i
Next tmpObj
Stop
End Sub