Hi,

pl try this, it may help u..

Note: pass your values as many in to this array

val=Array(23,11,21)
ad(val)
Function ad(val)
    Set exl=createobject("excel.application")
exl.Workbooks.Open "C:\Documents and Settings\Gopi\Desktop\Book1.xls"

set sht=exl.ActiveWorkbook.Worksheets(1)
rw=sht.usedrange.rows.count
For i=0 to uBound(val)
sht.Cells(rw+1+i,1)=val(i)
Next
exl.ActiveWorkbook.Save
exl.Quit
Set exl=Nothing
Set sht=Nothing
End Function





On Thu, Jul 14, 2011 at 12:03 PM, Kiran Ogeti <kse...@yahoo.com> wrote:

> I am calling a function to add data to excel sheet as below,.. basically
> wanting to add data as passing through arguments..
>
> but since its going to be numerous rows the data gets added..there are two
> problems
>
> 1. Create object and closing object, on every row added
> 2. opening and closing Excel, on every row added
>
> Is there anyway just keep the Excel sheet open and keep adding the rpw
> until its done?.. thanks alot
>
>
> Public function ExportResultstoExcel(datamine,RowStart,ColStart)'
>
>    FilePath ="C:\xxxxxxxx.xlsx"
>    Set xcelObject = createobject("Excel.application")
>    xcelObject.Workbooks.Open(FilePath)
>
>    xcelObject.Worksheets(1).Cells(RowStart,ColStart).value =datamine
>
> xcelObject.ActiveWorkbook.Save
> xcelObject.Workbooks.Close
> ,
>
> --
> 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 MercuryQTP@googlegroups.com
> To unsubscribe from this group, send email to
> mercuryqtp+unsubscr...@googlegroups.com
> 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
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to MercuryQTP@googlegroups.com
To unsubscribe from this group, send email to
mercuryqtp+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en

Reply via email to