The .net runtime is exposed to VBA (and other COM clients) via mscorlib.dll. In theory this means a VBA programmer can use .net classes.
I have used an ArrayList for sorting, and was trying to call other methods but for the IndexOf I have hit a problem. It won't take a literal for the paramter, it is expecting an Object. I thought maybe a boxed integer might work but that failed as well.
So how to lookup a literal number in an ArrayList from VBA?
Sub Test()
Dim obj As Object
Set obj = CreateObject("System.Collections.ArrayList")
obj.Add 4
obj.Add 8
obj.Add 12
obj.Add 16
obj.Add 20
Debug.Assert obj.Count() = 5
Debug.Assert obj.Item(2) = 12
'* try a literal
Debug.Print obj.IndexOf(12) 'ERRORS err.Description=Invalid procedure call or argument
'* try a boxed integer
Dim boxedInteger As mscorlib.Int32
boxedInteger.m_value = 12
Debug.Print obj.IndexOf(boxedInteger) 'ERRORS err.Description=Invalid procedure call or argument
End Sub