Dim dlg As New OpenFileDialog
dlg.Filter = "Excel文件|*.xls"
If dlg.ShowDialog = DialogResult.OK Then
Dim Book As New XLS.Book(dlg.FileName)
Dim Sheet As XLS.Sheet = Book.Sheets(0)
Tables("交易明细").StopRedraw()
'注意以下数组中列名称的顺序,必须和Excel表中的列顺序一致
Dim nms() As String = {"交易日期","交易地点","支出","收入","账户余额","对方账号","对方户名","摘要"}
'注意下面的循环变量从1开始,而不是从0开始,因为Excel表的第一行是标题
'逐行的获得值.
For n As Integer = 1 To Sheet.Rows.Count -1
Dim r As Row = Tables("交易明细").AddNew()
For m As Integer = 0 To nms.Length - 1
r(nms(m)) = Sheet(n,m).Value
Next
Next
Tables("交易明细").ResumeRedraw()
End If
以上代码仅供参考。