大红袍老师:帮看看这个代码哪里有问题,测试数据导不完整
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open("D:\工作台\350幅臂.xlsx")
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
Dim Rg As MSExcel.Range
Tables("汽车吊性能参数").StopRedraw()
Dim num As Integer=0
For c As Integer = 3 To 526
For r As Integer = 6 To 40
Rg = Ws.Cells(r,c)
If isnumeric(rg.Value) Then
Dim rw As Row = Tables("汽车吊性能参数").AddNew()
rw("车型") = "SANY350-70"
rw("工况类型")="副臂"
rw("支腿")="全伸"
Rg = Ws.Cells(2,c)
rw("副臂长")=rg.Value
Rg = Ws.Cells(3,c)
rw("配重")=Rg.Value
Rg = Ws.Cells(4,c)
rw("副臂角度")=rg.Value
Rg = Ws.Cells(5,c)
rw("主臂长")=rg.Value
Rg = Ws.Cells(r,2)
rw("幅度")=rg.Value
Rg = Ws.Cells(r,c)
rw("起重量")=rg.Value
Rg = Ws.Cells(47,c)
rw("主臂组合")=rg.Value
num=num+1
Else
Continue For
End If
Next
Next
Tables("汽车吊性能参数").ResumeRedraw()
MessageBox.Show("共成功导入" & num & "条数据!")
App.Quit