How to read from excel in QTP?
Set objexcel = createobject("Excel.Application")
Set objworkbook = objexcel.Workbooks.Open("Path of the excel")
Set objworksheet = objworkbook.Worksheets("sheetname")
objexcel.Visible = true
excelval = objworksheet.Cells(1,3).Value 'line to read excel value present in 1st row and 3rd column
Set objexcel = Nothing
Set objworkbook = Nothing
Set objworksheet = Nothing
Set objworkbook = objexcel.Workbooks.Open("Path of the excel")
Set objworksheet = objworkbook.Worksheets("sheetname")
objexcel.Visible = true
excelval = objworksheet.Cells(1,3).Value 'line to read excel value present in 1st row and 3rd column
Set objexcel = Nothing
Set objworkbook = Nothing
Set objworksheet = Nothing

Comments
Post a Comment