Results 1 to 14 of 14

Thread: How to Import the data from MS-Excel in QTP?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Expert Member
    Join Date
    Oct 2007
    Answers
    375

    Re: How to Import the data from MS-Excel in QTP?

    Hi,

    As Ramya suggested Importing data from excel sheet into your datatable can be achieved.

    But incase you wish to read Excel values into your script, try this....

    dim sExcelObj
    dim sWorkBook
    dim sWorkSheets
    dim sValue

    set sExcelObj = CreateObject("Excel.Application")
    sExcelObj.Visible = true
    set sWorkBook = sExcelObj.Workbooks.Open ("path of file")
    set sWorkSheets = sWorkBook.ActiveWorkbook.worksheets ("sheetname")

    sValue = sWorkSheets.cells(row,col).value

    You can also create an array to continously loop through your excel sheet and read all required values.

    Cheers...


  2. #2
    Junior Member
    Join Date
    Mar 2009
    Answers
    5

    Re: How to Import the data from MS-Excel in QTP?

    Quote Originally Posted by bizzzzzare View Post
    Hi,

    As Ramya suggested Importing data from excel sheet into your datatable can be achieved.

    But incase you wish to read Excel values into your script, try this....

    dim sExcelObj
    dim sWorkBook
    dim sWorkSheets
    dim sValue

    set sExcelObj = CreateObject("Excel.Application")
    sExcelObj.Visible = true
    set sWorkBook = sExcelObj.Workbooks.Open ("path of file")
    set sWorkSheets = sWorkBook.ActiveWorkbook.worksheets ("sheetname")

    sValue = sWorkSheets.cells(row,col).value

    You can also create an array to continously loop through your excel sheet and read all required values.

    Cheers...
    I've a question for bizzzzzare: Per your mention above(highlighted in red)Can you please guide me with creating an array of all the rows matching specified criteria by continously looping through the used range in an external excel sheet instead of the datatable.

    I'll really appreciate it.
    Thanks.


  3. #3
    Junior Member
    Join Date
    Mar 2009
    Answers
    5

    Re: How to Import the data from MS-Excel in QTP?

    Hi bizzzzzare! I've a question for you: Can you please tell me how can I create an array to continously loop through an excel sheet and read all required values. I'd really appreciate it. Thanks. I'm in the constant process of learning coding in QTP.


  4. #4
    Junior Member
    Join Date
    Dec 2013
    Answers
    2

    Re: How to Import the data from MS-Excel in QTP?

    datatable.AddSheet("AAAA")
    datatable.ImportSheet "D:\shiva\other\Keyword.xls","AA","AAAA"
    rc=datatable.GetSheet("AAAA").GetRowCount

    msgbox rc

    For i=1 to rc
    datatable.GetSheet("AAAA").SetCurrentRow(i)
    a=datatable.Value("shiva","AAAA")
    msgbox a
    Next


  5. #5
    Junior Member
    Join Date
    Dec 2013
    Answers
    2

    Re: How to Import the data from MS-Excel in QTP?

    Hi any one tell me that how to make word gabling??? shiva--->vasih (or) ivahs like this???


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact