Dim dlg As New OpenFileDialog '定义一个新的OpenFileDialog
dlg.Filter= "Excel文件|*.xls" '设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
Dim mg As New Merger
mg.SourcePath = dlg.FileName
mg.SourceTableName = "成绩统计$"
mg.Format = "excel"
mg.DataTableName = "初一学生成绩"
mg.Merge()
End If