Thursday, February 2, 2012

How to use .NET Collections to Excel VBA

(1) from the VBA editor, reference mscorlib.dll (.net's core lib)
(2) you can now do the following code

Dim myobj As New MyDotNetClass
Dim myvar As IEnumerable
Set myvar = myobj.GetDictionaryKeys()

For each key in myvar
   MsgBox key
Next key