Function Comparedata(strFileName1,strFileName2,ColumnName) Dim iShtCnt1,iShtCnt2,strSheetName,strSQLStatement1,iCurRow,Query,iColCnt,iCol,curColName,curColValue,CurQuery Dim bFound,j,strSQLStatement2,RecSet2,iRecordCnt Set oBook1 = oExcel.Workbooks.Open(strFileName1) Set oBook2 = oExcel.Workbooks.Open(strFileName2) iShtCnt1 = oBook1.Sheets.Count iShtCnt2 = oBook2.Sheets.Count If iShtCnt1 <> iShtCnt2 Then Reporter.ReportEvent micFail,"Compare Report - Sheets Count Mismatch":Exit Function oBook1.Close oBook2.Close oExcel.Quit Set oExcel = Nothing Set objCon2 = ConnectToExcel(strFileName2) For i = 1 to iShtCnt1 strSheetName = allSheetNames(i-1) strSQLStatement1...