Dim dlg As New OpenFileDialog
dlg.Filter = "exce|*.xls"
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
这样,报错,找不到文件,咋回事?
这是根据帮助文件里面改的
但是下面的写法就对,咋回事?
Dim mg As New Merger
mg.SourcePath = "c:\data\"零件清单明细".xls"
mg.Format = "excel" '指定格式
mg.SourceTableName = "零件清单明细" '指定要合并的表
mg.DataTableName = "零件清单明细" '指定接收数据的表
mg.Merge() '开始合并这样写就