Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP and Excel
#2
Solved: 10 Years, 9 Months, 4 Weeks ago
You need to use Automation Object Model(AOM)

try this code:

Code:
Dim filepath, sheet,row,column,value  
   filepath= "C:\qtp_test.xls"
   Set ExcelObj = CreateObject("Excel.Application")
   ExcelObj.Workbooks.Open filePath //opens the excel from desired path
   Set NewSheet = ExcelObj.Sheets.Item(sheet) //selects the sheet from workbook
   value = NewSheet.Cells(row,column) //gets the value of a specified cell
   ExcelObj.Application.Quit
   Set ExcelObj = Nothing
   msgbox value
Want to fast track your QTP/UFT Learning? Join our UFT Training Course
Reply


Messages In This Thread
QTP and Excel - by Sonia - 02-13-2008, 05:39 AM
RE: QTP and Excel - by Ankur - 02-13-2008, 11:35 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  excel macro to open QTP from excel karthik1979_us 1 10,932 11-07-2009, 02:57 AM
Last Post: geethwind

Forum Jump:


Users browsing this thread: 1 Guest(s)