Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog dlg.Filter= "excle|*.xls" '设置筛选器 If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮 Dim mg As New Merger mg.SourcePath = dlg.FileName mg.Format = "excel" '指定格式 Dim book As new XLS.Book(dlg.FileName) mg.SourceTableName = book.sheets(0).name & "$" mg.DataTableName = "WL" mg.Merge() End If