我在vba,excel中有以下代码。首先,我创建了类“列表”:
Public next as List
Public val as Integer
接下来我想做这样的事情
Sub Test()
Dim ls as List
Set ls = new List
Set_val ls.next, 8
Debug.Print (ls.next is Nothing) 'True - why?
Debug.Print ls.next.val 'Error
end sub
Sub Set_val(l as List, v as Integer)
Set l = new List
l.val = v
end sub
但它不起作用,我收到错误消息“未设置块变量的对象或变量”。你知道它应该如何正确完成吗?