If fl.ToLower.EndsWith(".xlsx") Then Dim Book As New xls.Book(fl) For Each Sheet As xls.Sheet In Book.Sheets '引用新增加的工作表 Dim mg As New Merger mg.SourcePath = fl '指定数据文件所在目录 mg.Format = "excel2007" '指定格式 mg.SourceTableName = sheet.Name & "$" mg.DataTableName = "成绩库" '指定接收数据的表 mg.Merge() '开始合并 Next