Hi,

Please find the below code to work with excel sheet,
Function addExcexl(sPath)

    Set oExcel=CreateObject("Excel.application")
    oExcel.Visible=True

    set oWorkbook=oExcel.Workbooks.Add
    ''Set oWorkSheet=oExcel.Worksheets.Add("shekhar")
    

    oWorkbook.SaveAs(sPath)

End Function

''Call addExcexl("d:\shekhar"&rnd&".xls")

Function Writedata(sPath)

   Set oExcel=CreateObject("Excel.ApplicatIon")
   oExcel.Visible=True

   Set oWorkBook=oExcel.Workbooks.Open(sPath)
   Set oWorkSheet=oExcel.Worksheet.Add
    oWorkSheet.name="shekhar11"

    oWorkSheet.cells(1,1).value="ranjhna"


End Function

''Call Writedata("d:\shekhar1.xls")

Function ReadData(spath)

    Set oExcel=CreateObject("Excel.application")
    oExcel.Visible=True
    Set oWorkBook=oExcel.Workbooks.Open(sPath)

    Set oWorksheet=oExcel.Sheets("shekhar")
    nRow= oWorkBook.Worksheets("shekhar").usedrange.rows.count
    nColumn=oWorkBook.Worksheets("shekhar").usedrange.columns.count

    For i=1 to nRow
        For j=1 to nColumn

            msgbox oExcel.Cells(i,j).value

        Next

    Next




On Monday, July 28, 2014 4:26:03 PM UTC+5:30, udhaya kumar wrote:
>
> Hi All,
>
> what is the best way to write function for reading value from excel column 
> cell.
>
>
> Instead of using *rowcount* and *columncount*, any other way to read cell 
> value without affecting the performance of the excel application.
>
> [image: Inline image 1]
>
> Regards,
> Udhay
>

-- 
-- 
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

--- 
You received this message because you are subscribed to the Google Groups "QTP 
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to