以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  批量导入EXCEL  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=190925)

--  作者:atlas77
--  发布时间:2024/3/14 14:57:00
--  批量导入EXCEL
请问我有100个EXCEL不同名工作薄,每个工作薄里各有1个工作表(也不同名),请问如何批量导入FOXTABLE生成100个表格(名称同工作薄名称)
--  作者:有点蓝
--  发布时间:2024/3/14 15:10:00
--  
Dim dlg As New OpenFileDialog
dlg.MultiSelect = 
True
dlg.Filter= "Excel文件|*.xls" \'设置筛选器
If
 dlg.ShowDialog = DialogResult.OK Then
    For
 Each fl As String In dlg.FileNames
Dim Book As New XLS.Book(fl)
Dim name
 As string = Book.Sheets(0).name
Dim ip as New Importer
ip
.SourcePath = fl \'指定数据文件
ip
.SourceTableName = name & "$" \'指定要导入的表
ip.NewTableName =name \'导入后的表名
ip.Format = "Excel" 
\'指定导入格式

ip
.Import()
    Next
End
 If