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
For r1 = 0 To Tables("进货").Rows.Count - 1
Ws.Cells(r1 + 4, 1) = Tables("进货").Rows(r1)("品名")
Ws.Cells(r1 + 4, 2) = Tables("进货").Rows(r1)("型号")
Next r1
更换上面代码倒数2和3行为下面的变量
Ws.Cells(r1 + 3, c1) = Tables("进货").Rows(r1)(c2)