以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  [原创]  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=184306)

--  作者:zhanghaohao
--  发布时间:2022/12/2 9:25:00
--  [原创]

                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不成功,是哪里的问题


--  作者:有点蓝
--  发布时间:2022/12/2 9:40:00
--  
新建项目做个例子,把"yuangongxiaoshou"表导入新项目,然后把execl文件一起发上来测试
--  作者:有点蓝
--  发布时间:2022/12/2 9:40:00
--  
http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=50080