请问各位大神,怎么用程序一次导入多个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