Hi Nidhi,
please check below possible issues.
1. there might be xlsx and you are giving xls.
2. "objExcel.Workbooks.Add" are you trying to add new workbook?
check after removed it.
thanks,
Vishal
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.