以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]怎么用程序一次导入多个Excel文件,并汇总  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=117259)

--  作者:董小奕
--  发布时间:2018/4/9 17:11:00
--  [求助]怎么用程序一次导入多个Excel文件,并汇总

请问各位大神,怎么用程序一次导入多个Excel文件,并汇总?

之前写了个程序,报错为:不可识别的数据库格式 \'C:\\data\\订单.xlsx\'。

以下为代码

Dim dlg As New OpenFileDialog
dlg.Filter = "Excel文件|*.xlsx"
dlg.MultiSelect = True \'允许选择多个文件
If dlg.ShowDialog =DialogResult.OK Then
    For Each fl As String In dlg.FileNames
        Dim mg As New Merger
        mg.SourcePath = fl
        mg.SourceTableName = "订单"
        mg.DataTableName = "订单"
        mg.Merge()
    Next
End If


--  作者:有点甜
--  发布时间:2018/4/9 18:16:00
--  

Dim dlg As New OpenFileDialog
dlg.Filter = "Excel文件|*.xlsx"
dlg.MultiSelect = True \'允许选择多个文件
If dlg.ShowDialog =DialogResult.OK Then
    For Each fl As String In dlg.FileNames
        Dim mg As New Merger
        mg.SourcePath = fl
        mg.Format = "Excel"
        mg.SourceTableName = "订单$"
        mg.DataTableName = "订单"
        mg.Merge()
    Next
End If