在EXCEL VBA中调用C#dll-如何访问列表项?
我用c#编写了类库,如下(简化):在EXCEL VBA中调用C#dll-如何访问列表项?,c#,vba,excel,C#,Vba,Excel,我用c#编写了类库,如下(简化): 如何调用方法“GetSomePoints”?我如何访问VBA中列表的项目?检查此链接:Im affraid这对我没有帮助-HelloWorld方法返回字符串,我需要处理对象列表:(检查此链接:-VBA不支持列表泛型类,可以使用Collection;) namespace DotNetLibrary { public class CPoint { public int x; public int y;
如何调用方法“GetSomePoints”?我如何访问VBA中列表的项目?检查此链接:Im affraid这对我没有帮助-HelloWorld方法返回字符串,我需要处理对象列表:(检查此链接:-VBA不支持列表泛型类,可以使用Collection;)
namespace DotNetLibrary
{
public class CPoint
{
public int x;
public int y;
public CPoint(int x, int y)
{
this.x = x;
this.y = y;
}
public List<CPoint> GetSomePoints()
{
List<CPoint> result = new List<CPoint>();
for (int i = 0; i < 100; i++)
{
for (int j = 0; j < 100; j++)
{
result.Add(new CPoint(i, j));
}
}
return result;
}
}
}
Private Sub TestDotNetCall()
Dim pt As New CPoint
End Sub