Forum Discussion

mohamed_mansoor's avatar
mohamed_mansoor
Occasional Contributor
12 years ago

How to post the test results in excel sheet

Hi All,



I have one function like TestResult(TCNO,RESULT)

i will pass the TCNO and Result to this function i want result in excel sheet like (Row1,column1)=TC1,(Row1,column2)=Pass,(Row2,column1)=TC2,(Row2,Column2)=Fail and so on.



I am using jscript for that.Pleas anybody know do the needful help



Thanks and Regadrs,

Mohamed Mansoordeen.M

3 Replies

  • Ravik's avatar
    Ravik
    Super Contributor
    Hi Mohamed, Please refer below example, it will be work for you. using this code you can write in Excel -



    Sub ExcelTest

           Set Exo = CreateObject("Excel.Application")

           Set wbo = exo.workbooks.open("Path of your file")

           Exo.Application.Visible = true

           Delay(1000)

           Set wso = wbo.Worksheets("Sheet1")

           row = wso.usedRange.rows.count

          col = wso.usedRange.Columns.count

                for j = 1 to col

                For i = 2 to row - 1

                    UID = varToString(Exo.Cells(i, j)) - (Read data from Excel)

                    Exo.Cells(i, 2) = varToString("Pass/Fail") - (write Result in 2 col, 2 is second Col you can replace it with your sutable)

                Next

           Next

    End Sub



    This will be help you !
  • mohamed_mansoor's avatar
    mohamed_mansoor
    Occasional Contributor
    Dear Ravi



    Thanks for your valuable reply.

    I am using Jscript.i don't understand VB script.it is very difficult to me to convert into jscript



    Thanks and Regards,

    Mohamed Mansoordeen.M