Dim App As New MSExcel.Application
App.Visible = True
Dim Wb As MSExcel.Workbook = App.WorkBooks.Open("g:\1.xls")
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1) '第1张表
Dim dr As DataRow = DataTables("进货").DataRows(0)
Ws.Cells(2, 3) = dr("品名")
datatable是没有顺序的,如果要取界面的第1行应该使用table
Dim dr As Row = Tables("进货").Rows(0)
Dim App As New MSExcel.Application
App.Visible = True
Dim Wb As MSExcel.Workbook = App.WorkBooks.Open("g:\1.xls")
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1) '第1张表
Dim r1 As Integer, c1 As New List(Of Integer) From {1, 2}, c2 As New List(Of String) From {"品名", "型号"}
For r1 = 0 To Tables("进货").Rows.Count - 1
Ws.Cells(r1 + 3, c1) = Tables("进货").Rows(r1)(c2)
Next r1
上传方法:http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&Id=78