请问下面的代码如何在导入前把EXCEL文件中 - - 的替换成空,还有实现同时多个EXCEL文件导入?谢谢
Dim dlg As New OpenFileDialog
dlg.Filter= "Excel文件|*.xls;*.xlsx" '设置筛选器
If dlg.ShowDialog = DialogResult.Ok Then '如果用户单击了确定按钮
DataTables("dkye").StopRedraw
Dim App As New MSExcel.Application
try
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(dlg.FileName)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
Dim Rg As MSExcel.Range = Ws.UsedRange
Dim ary = rg.value
For n As Integer = 5 To rg.Rows.Count - 1
Dim ro As Row = Tables("dkye").AddNew
For i As Integer = 0 To Tables("dkye").Cols.Count - 6
ro(i) = ary(n,i+1)
ws.usedrange.replace (" - -","")
Next
Next
MessageBox.Show("导入成功!","恭喜!")
catch ex As exception
msgbox(ex.message)
MessageBox.Show("导入失败!","恭喜!")
finally
DataTables("dkye").ResumeRedraw
app.quit
End try
End If