Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Compare a link name to a column in Excel
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Lorena,

Yes comaparing a link with entire coulmn seems to be tricky and time consuming as well. One idea would be to use the excel Find property to check for the value which we are looking for.

I have developed the below code which worked fine for me. Can you try and check on your side if this solves your purpose?

'***********************************************************

strSearchedItem ="91773978"'please specify the link that you want to search

Code:
Set objExcel = CreateObject("Excel.Application")

Set objWorkbook = objExcel.Workbooks.Open("C:\TestData_SAP_FICO_FI_VF11_CANCEL BILL DOC_037.xls") 'Enter the file path

Set actualValues  = objWorkbook.Worksheets("FICO_CANCEL_BILL_DOC") 'Enter the sheet name

objExcel.Visible=True '

intFoundRow = actualValues.Columns(4).Find(strSearchedItem).Row ' Find the searched item in excel on the column specified

intRowCount = actualValues.UsedRange.Rows.Count 'Get the total row count

If intFoundRow > intRowCount Then
    Reporter.ReportEvent micFail, "Item " &strSearchedItem & " not found in Report", ""
else
   Reporter.ReportEvent micPass, "Item " &strSearchedItem & " found in Report", "Item " & strSearchedItem & " found in Report in line " & intFoundRow
End If

'Release the objects
objExcel.Visible=False
Set actualValues=Nothing
Set objWorkbook=Nothing
objExcel.Quit
Set objExcel=Nothing

'*********************************************************

Regards,
Ankesh
Reply


Messages In This Thread
RE: Compare a link name to a column in Excel - by Ankesh - 01-23-2012, 11:15 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [UFT] Get column name from SfwObject felino 0 3,013 12-02-2015, 04:07 PM
Last Post: felino
  Compare WebTable Elements saraiado 1 2,554 06-11-2015, 06:54 PM
Last Post: venkatesh9032
  How to compare two binary values Naresh 0 2,339 09-09-2014, 05:06 PM
Last Post: Naresh
  Unable to right click column header sudhirzpatil 4 6,382 07-18-2013, 09:42 PM
Last Post: sudhirzpatil
  datatable column exist diya 3 12,532 12-11-2012, 11:24 AM
Last Post: elango87

Forum Jump:


Users browsing this thread: 1 Guest(s)