20200504导入每个月的excel文件
Dim dlg As New FolderBrowserDialog
Dim ml As String
If dlg.ShowDialog = DialogResult.Ok Then
ml = dlg.SelectedPath
End If
For Each file As String In filesys
.GetFiles(ml)
If file.EndsWith(".xls") OrElse
file.EndsWith(".xlsx") Then
output.Show("正在处理: " & file)
Dim ip As New Importer
ip.SourcePath = file '指定数据文件
ip.SourceTableName = "Sheet2"
ip.Fields = "个人编号,民政排序,数量,农村五保户,城市三无,建档立卡的贫困人口,省定扶贫标准下的低保对象,农村低保户,特困大学生,城市低保户,困难大学生,计划生育特殊家庭成员,重度残疾人,重点优抚,革命五老,五老遗属,独子户,独女户,二女户,残疾人,孤儿,民政最高救助类型,姓名,身份证,参保状态,险种,账目参保身份,到账来源,乡村组,乡镇,账目分中心,民政区县"
Dim bm As String = "医保" &
file.SubString(49,8)
If DataTables.Contains(bm)
MessageBox.Show(bm & "存在同名表!")
ip.NewTableName = bm &
"_02"
Else
ip.NewTableName = bm
End If
ip.Format = "Excel" '指定导入格式
ip.Import()
End If
Next