pavel
12-20-2013, 08:15 AM
Hello everyone!
I wrote class library in c# like this (simplified):
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(int i_max, int j_max)
{
List<CPoint> result = new List<CPoint>();
for (int i = 0; i <= i_max; i++)
{
for (int j = 0; j <= j_max; j++)
{
result.Add(new CPoint(i, j));
}
}
return result;
}
}
}
In Excel in VBA I can create instance of class CPoint like this:
Private Sub TestDotNetCall()
Dim pt As New CPoint(100, 100)
End Sub Can you please help me, how can I call method 'GetSomePoints' in VBA? And how can I access to the items of the List in VBA?
Thanks,
Pavel
I wrote class library in c# like this (simplified):
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(int i_max, int j_max)
{
List<CPoint> result = new List<CPoint>();
for (int i = 0; i <= i_max; i++)
{
for (int j = 0; j <= j_max; j++)
{
result.Add(new CPoint(i, j));
}
}
return result;
}
}
}
In Excel in VBA I can create instance of class CPoint like this:
Private Sub TestDotNetCall()
Dim pt As New CPoint(100, 100)
End Sub Can you please help me, how can I call method 'GetSomePoints' in VBA? And how can I access to the items of the List in VBA?
Thanks,
Pavel