created COM component in C# and called it in VBA. VBA Code:
Sub test()
For i = 1 To 1000
Dim p As ClassLibrary1.Point
Set p = New ClassLibrary1.Point
Dim surface As ClassLibrary1.surface
Set surface = New ClassLibrary1.surface
Debug.Print surface.Create(p)
Next i
End Sub
ClassLibrary1 consists of a DLL and a TLB (which I reference in my VBA)ClassLibrary1 has classes and respective interfaces for Point and Surface.
When I run this, Excel causes an increase in memory (as seen from Windows Task Manager)
of 700KB (approx) and every time I run this, it increases and remains constant.
I tried setting the objects to 'Nothing' but it doesnt help. Any ideas?