0
我有一个包含一个类的实例的字典。不知何故,我无法找到一种方法来改变一个值(分配新的类实例)到字典。类实例字典,如何分配新值?
例如
Dim t as new Product
'initialize t
if dictionaryP.Exists(keyValue) then
'in the next line i get an error "Object doesn't support this property or method"
dictionaryP.Item(keyValue)=t
else
'no problem with this line...
dictionaryP.Add keyValue, t
end if
找不到任何关于使用字典中VBA 与那些对象,不只是简单的字符串或整数值的任何信息。 我如何更改字典存储对象(类实例)的字典价值,因为它似乎我不能使用
dictionary.Item(key) = <new Object value> ' as i thought it sould be, from this source
我缺少做呢?如果值是对象(不是简单的值),我该如何更改字典值?
非常感谢!应该自己想过:) – Prokurors 2013-05-05 15:39:10