Dim cm2 As WinForm.ComboBox = e.Form.Controls("ComboBox2")
If cm2.Text="" Then
MessageBox.Show("请先选择要接收的数据表,然后再进行文件选择.字段匹配.数据导入操作!","温馨提示")
Else
Dim c4 As WinForm.ComboBox = e.Form.Controls("ComboBox4")
If c4.text ="" Then
Else
Dim b1 As String= "1:" & c4.text
With e.Form
Dim dlg As New OpenFileDialog
dlg.Filter= "Excel 97-2003文件(*.xls)|*.xls|Excel 2007文件(*.xlsx)|*.xlsx"
If dlg.ShowDialog = DialogResult.Ok Then
Dim App As New MSExcel.Application
Dim Wb As MSExcel.WorkBook = App.WorkBooks.Open(dlg.FileName)
Dim Ws As MSExcel.WorkSheet = Wb.WorkSheets(1)
Dim Rg As MSExcel.Range = Ws.Rows(b1) '选定多行
Rg.EntireRow.Delete(MSExcel.XlDirection.xlToLeft) '右面的单元格左移
App.Visible = False
If cm2.text="走读式谈话台账" Then
Dim Rg1 As MSExcel.Range = Ws.Range(Ws.Cells(1,8))
Rg1.Value = "谈话开始时间"
Dim Rg2 As MSExcel.Range = Ws.Range(Ws.Cells(1,9))
Rg2.Value = "谈话结束时间"
End If
If Wb.WorkSheets(1).name ="sheet1" Then
Wb.WorkSheets(1).name = "走读式谈话台账"
End If
Dim t1 As String =Format(Date.Now,"yyyyMMddhhmmss")
Dim dz As String = FileSys.GetParentPath(dlg.FileName) & t1 & FileSys.GetName(dlg.FileName)
Wb.SaveAs(dz)
wb.close
app.quit
'.Controls("TextBox1").value = dz
'.Controls("ComboBox1").Value = ""
'.Controls("Table1").Table.DataTable.DataRows.clear()
'.Controls("ComboBox1").Select()
End If
End With
End If
End If
运行出现如下错误:
上述红色代码部分怎么修正呢?