[求助]数据合并如何避免重复导入 Post By:2017/1/16 14:54:00 [显示全部帖子]
Dim dlg As New OpenFileDialog dlg.Filter = "Excel文件|*.xls" If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮 Dim mg As New Merger mg.SourcePath = dlg.FileName mg.Format = "excel" '指定格式 Dim App As New MSExcel.Application Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(dlg.FileName) Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1) mg.SourceTableName = ws.name & "$" mg.DataTableName = "明细表" '指定接收数据的表 mg.Merge() '开始合并 End If