以文本方式查看主题 - Foxtable(狐表) (http://foxtable.com/bbs/index.asp) -- 专家坐堂 (http://foxtable.com/bbs/list.asp?boardid=2) ---- [求助]Excel里面有多个sheet,如何一次性导入合并 (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=188377) |
-- 作者:gengwvi -- 发布时间:2023/9/17 12:06:00 -- [求助]Excel里面有多个sheet,如何一次性导入合并 [求助]Excel里面有多个sheet,如何一次性导入合并;
|
-- 作者:有点蓝 -- 发布时间:2023/9/17 20:43:00 -- 遍历所有sheet,比如 Dim Book As New XLS.Book("c:\\reports\\test.xls") Dim lst As New List(Of String) For Each sheet As XLS.Sheet In Book.Sheets lst.Add(sheet.Name & "$") Next For Each s As String In lst Dim mg As New Merger mg.SourcePath = "c:\\reports\\test.xls" mg.Format = "excel" \'指定格式 mg.SourceTableName = s \'指定要合并的表 mg.DataTableName = "订单" \'指定接收数据的表 mg.Merge() \'开始合并 Next |