|
要求打印出文件内两列的数据:在QTP读取EXCEL文件时,传入一个EXCEL文件名,但为什么只打印出第一列的值,而不打印第二列呢?试验了好多次都没看出什么原因。哪位大侠帮看下哈
Public Function ImportFile(byref filePath)
On error resume next
datatable.ImportSheet filePath,"Sheet1","Action1"
Dim dtSheet,dtMp1,dtMp2,dataItem
Set dtSheet = datatable.GetSheet("Action1")
For dataItem = 0 to dtSheet.getRowCount
dtMp1 = datatable("mp","Action1")
dtMp2 = databale("mpConfirm","Action1")
msgbox(dtMp1&"*"&dtMp2)'为什么此句只打印dtMp1的值,而不打印dtMp2的值?
next
If err <> 0 Then
Call WriteMsg(logFileNow,"导入EXCEL文件时发生异常:"&"错误码:"&err.number&" 错误描述:"&err.source&" 错误原因:"&err.description)
End If |
|