Dim tb As Table = Tables("yuangongxiaoshou")
Dim dtb As DataTable = DataTables("yuangongxiaoshou")
Dim kairow As Integer = riqizhi
Dim dtrows As List(Of DataRow)
dtrows = DataTables("yuangongxiaoshou").Select("riqi>=" & kairow)
If dtrows.Count > 0 Then
For Each dtrw As DataRow In dtrows
dtrw.Delete
Next
End If
'导入数据
Dim filname As String = "C:\Users\Administrator\Desktop\" & dizhi
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(filname)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
Dim Rgs As MSExcel.Range = Ws.UsedRange
Dim hang As Integer = Rgs.Rows.Count
Wb.Save
Wb.Close
App.Quit
Dim _execl As New ExOpenXml.ExOXExecl()
_execl.Open(filname, True)'打开
_execl.AppendToDataTable(DataTables("yuangongxiaoshou").Basetable, , ,0, hang - 1)
_execl.Dispose()
tb.ResumeRedraw
DataTables("yuangongxiaoshou").save()
导入Excel不成功,是哪里的问题