Dim path = ProjectPath
If FileSys.FileExists(path & "经营应收表.xlsx") Then '如果指定的文件存在
FileSys.DeleteFile(path & "经营应收表.xlsx",2,2) '则彻底删除之
End If
Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(dlg.FileName)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1) '指定要复制的工作表
Ws.Copy '复制到一个新工作簿
Dim Wb1 As MSExcel.WorkBook = app.ActiveWorkbook
Dim ws1 As MSExcel.WorkSheet = Wb1.WorkSheets(1)
ws1.Saveas(path & "经营应收表.xlsx")
wb.close
wb1.close
App.Quit
End If
Dim mg As New Merger
mg.SourcePath = path & "经营应收表.xlsx" '指定数据文件
mg.SourceTableName = "统计表$" '指定要合并的表
mg.FieldMaps.Add("客户全称","经营客户名")
mg.FieldMaps.Add("期末余额","经营余额")
mg.Fields = "年度,月份,经营客户名,经营余额"
mg.DataTableName ="经营应收余额表" '合并后的表名
mg.Format = "Excel" '指定合并格式
mg.Merge()
此主题相关图片如下:qq截图20200821003814.png
请问老师们,提示这个是啥意思?