@Prakash You have to close the workbook first and then you can close the application. Please modify your script like below
workBook.save workBook.Close myxl.quit Set mysheet =nothing Set workBook=nothing Set myxl = nothing Thanks & Regards Uma Mahesh On Fri, Dec 6, 2013 at 10:10 AM, Omprakash P <[email protected]> wrote: > Thank you Ganesh for your valuable information. > > > > Regards, > Omprakash > > > On Thursday, December 5, 2013 7:13:49 PM UTC+5:30, Omprakash P wrote: >> >> Hi, >> >> Currently i am facing the problem with excel file unable to open after >> reading the data through qtp. >> i used the bellow code for read the data. >> >> Set myxl = createobject("excel.application") >> Set workBook=myxl.Workbooks.Open("E:\Projects\Data.xls") >> set mysheet =workBook.worksheets("Login") >> >> Field1= mysheet.cells(2,2).value >> Field2= mysheet.cells(3,2).value >> Field3=mysheet.cells(4,2).value >> Field4=mysheet.cells(5,2).value >> Field5=mysheet.cells(6,2).value >> >> >> myxl.ActiveWorkbook.Close >> myxl.Application.Quit >> Set mysheet =nothing >> Set workBook=nothing >> Set myxl = nothing >> >> After running the code unable to open the file manually. >> > -- > -- > 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/groups/opt_out. > -- -- 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/groups/opt_out.
