您可能需要对此进行一些调试。您可以通过多种方式进行验证。你的问题太笼统,无法给出具体答案。请提供下一个问题的具体细节
introwcount=browser("SAP Transcation iView").Page("SAP Transaction iView").SAPFrame("Generate Leave Entitlement").WebTable("WebTable).RowCount
intcolcount=browser("SAP Transaction iView").Page("SAP Transaction iView").SAPFrame("Generate Leave Entitlement").WebTable("WebTable").ColCount(r)
Set objExcel = CreateObject("Excel.Application")
Set objWorkBook = objExcel.WorkBooks.Open(FilePath)
set objSheet = objWorkBook.Sheets(SheetName)
intSheetRowCount = objSheet.UsedRange.Rows.Count
intSheetColCount = objSheet.UsedRange.Columns.Count
blnFlag = True 'setting the default value first
If intSheetRowCount <> introwcount OR intSheetColCount <> intcolcount Then
blnFlag = False
End if
If blnFlag = true Then
for r = 1 to introwcount
for c = 1 to intcolcount
strExcelValue = ""
strTableValue = ""
strExcelValue = objSheet.Cells(introwcount, intcolcount).value
strTableValue = browser("SAP Transcation iView").Page("SAP Transaction iView").SAPFrame("Generate Leave Entitlement").WebTable("WebTable).GetCellData(introwcount,intcolcount)
If (strComp(strExcelValue, strTableValue, 0) <> 0 Then
blnFlag = False 'Used for resulting purpose
End If
Next
Next
End If
if blnFlag = True then
msgbox "Pass"
Else
msgbox "Fail"
End If
Set objSheet = Nothing
objWorkBook.Close
Set objWorkBook = Nothing
objExcel.Quit
Set objExcel = Nothing