01-27-2011, 10:51 PM
Hi,
As tarun suggested, use .xls format file instead .xlsx format excel files as they are not supported by QTP.
As tarun suggested, use .xls format file instead .xlsx format excel files as they are not supported by QTP.
Code:
Dim xl
Set xl=CreateObject("Excel.Application")
xl.WorkBooks.Open "your excel file path"
xl.Sheets("Sheetname").Select
UserId=xl.Cells(1,1).value
FirstName =xl.Cells(1,2).value
LastName=xl.Cells(1,3).value
Browser("...").Page("...").WebEdit("UserId").Set UserId
Browser("...").Page("...").WebEdit("FirstName ").Set FirstName
Browser("...").Page("...").WebEdit("LastName").Set LastName
xl.ActiveWorkBook.Save
xl.Application.Quit
Set xl=nothing