Dim dlg As new OpenFileDialog dlg.Filter = "Excel|*.xls;*.xlsx" If dlg.ShowDialog = DialogResult.OK Then Dim book As new XLS.Book(dlg.FileName) For Each sheet As XLS.Sheet In book.Sheets Dim ip As New Importer ip.SourcePath = dlg.FileName ip.SourceTableName = sheet.Name & "$" '指定要导入的表 ip.NewTableName = sheet.name.trim() '导入后的表名 ip.Format = "Excel" '指定导入格式 ip.Import() Next End If
|