Hi nidhi,

In your task manager, try to kill all excel processes and retry your code. 
I some how see your code is not that accurate.

Please watch my below video to know how to work with Excel File.
How to work with Excel using QTP 
<http://qtpftvideos.blogspot.in/2012/12/how-to-work-with-excel-using-qtp.html>

Thanks,
Uday
QTP / UFT Videos <http://qtpftvideos.blogspot.com>

On Thursday, 22 January 2015 18:15:33 UTC+5:30, nids wrote:
>
> Hi,
>
> I got stuck to 1 problem,please help me to solve this.
>
> If I try to open an excelsheet using VB script code ,I am unable to open 
> it.
> Below is the code.
>
>   Set objExcel = CreateObject("Excel.Application")
> Set objWorkbook = objExcel.Workbooks.Open("C:\Test\Book1.xls")
>
> objExcel.Application.Visible = True
> objExcel.Workbooks.Add
> objExcel.Cells(1, 1).Value = "Test value"
>
> objExcel.ActiveWorkbook.Save "C:\Test\Book1.xls"
> objExcel.ActiveWorkbook.Close
>
> objExcel.Application.Quit
>
> But when I try to open it manually I am able to open it and also able to 
> save the text in the workbook cell which I am unable to do currently,not 
> even able to put any value in workbook cell.
>
> Thanks,
> Nidhi Sharma
>

-- 
-- 
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