Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog dlg.Filter= "Excel文件|*.xls" '设置筛选器 If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮 Dim book As new XLS.Book(dlg.FileName)
Dim mg As New Merger mg.SourcePath = dlg.filename mg.Format = "excel" '指定格式 mg.SourceTableName = book.Sheets(0).name & "$" '指定要合并的表 mg.DataTableName = "商品主数据" '指定接收数据的表 mg.Merge() '开始合并 End If