Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/289.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在EXCEL VBA中调用C#dll-如何访问列表项?_C#_Vba_Excel - Fatal编程技术网

在EXCEL VBA中调用C#dll-如何访问列表项?

在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;

我用c#编写了类库,如下(简化):


如何调用方法“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