改成这样,注意红色地方,excel的后缀名要写正确,里面的表名sheet1也要写正确
Dim mg As New Mergermg.SourcePath = "c:\cb.xls"mg.Format = "excel" '指定格式mg.SourceTableName = "cb$" '指定要合并的表mg.DataTableName = "cb" '指定接收数据的表mg.Merge() '开始合并