Copy List of Structures to Excel Range

Posted by KDP on Stack Overflow See other posts from Stack Overflow or by KDP
Published on 2011-01-06T16:30:53Z Indexed on 2011/01/06 16:53 UTC
Read the original article Hit count: 208

Filed under:
|
|
|

Does anyone know how to copy a VB.Net list of structures to an Excel range? It's not hard to do with an array, but I can't get a list of structures to work.

Example:

Structure MyStruct  
    Dim MyField1 as String  
    Dim MyField2 as Integer  
End Structure  

Dim MyList As New List(Of MyStruct)  
...populate list of structures...  

Dim rng as Excel.Range = MySheet.Range("A1","B9")  
rng.??? = MyList  '*** This is where I get stuck. ***

© Stack Overflow or respective owner

Related posts about vb.net

Related posts about excel