【发布时间】:2009-09-25 22:45:23
【问题描述】:
我的 .net 代码有一个具有许多通用属性的对象。该对象返回给 VBA 代码。所有非泛型属性都运行良好,但我还需要访问泛型值。有没有办法从 VBA 中做到这一点?
[ClassInterface(ClassInterfaceType.AutoDual)]
public class Obj
{
public string GetProp1() {...}
public IList<MyCustomType> GetProp2() {...}
}
VB代码:
Sub Test()
Dim o As Program.Obj
Set o = New Program.Obj
Set p2 = hp.GetProp2()
set p2_0 = p2(0) ' doesn't work
End Sub
【问题讨论】: