DataTables("各地库存").DeleteFor("") For Each File As String In FileSys.GetFiles("D:\MG\report") Dim finfo As new fileinfo(file) If finfo.Extension = ".xls" OrElse finfo.Extension = ".xlsx" Then Dim mg As New Merger mg.SourcePath = File mg.Format = "excel" '指定格式 mg.SourceTableName = "仓库物料表_主表" mg.DataTableName = "各地库存" '指定接收数据的表 mg.Merge() '开始合并 End If Next