比如:
Dim s1 As new List(of String)
For Each r As Col In Tables("SubjectList").Cols
s1.Add(r.Name)
Next
Dim Book As New XLS.Book("c:\test\订单.xls")
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Dim dict As new Dictionary(of String,Integer)
Tables("订单").StopRedraw()
For m As Integer = 0 To Sheet.Cols.Count - 1
If s1.Contains(Sheet(0,m)) Then
dict.add(Sheet(0,m),m)
End If
Next
'注意下面的循环变量从1开始,而不是从0开始,因为Excel表的第一行是标题
For n As Integer = 1 To Sheet.Rows.Count -1
Dim r As Row = Tables("订单").AddNew()
For Each key As String In dict.Keys
r(key) = Sheet(n,dict(m1)).Value
Next
Next
Tables("订单").ResumeRedraw()