Hi all,
///////////////////////////////////////////////
when i run this script i get an run error like this
////////////////////////////////////////////////////////
The test run cannot continue due to an unrecoverable error.
Microsoft Office Excel cannot access the file 'C:\76149810'. There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.
////////////////////////////////////////////////////////////////
The data 111111111 and 22222222 was written into the excel sheet.
I think i have to open the file in the append mode as it tries to write a new file with the same name.Can anyone help me how to open the xlsx
file in the append mode
Thanks
Code:
Set oexcel = CreateObject("Excel.Application")
Set obook = oexcel.Workbooks.Open("C:\QTP_Assignment.xlsx","Append")
Set objDriverSheet = obook.Worksheets("Mukesh")
' Writing values into excel sheet
objDriverSheet.Cells(2,5) = "111111111"
objDriverSheet.Cells(3,5) = "22222222"
obook.Save
obook.Close
///////////////////////////////////////////////
when i run this script i get an run error like this
////////////////////////////////////////////////////////
The test run cannot continue due to an unrecoverable error.
Microsoft Office Excel cannot access the file 'C:\76149810'. There are several possible reasons:
• The file name or path does not exist.
• The file is being used by another program.
• The workbook you are trying to save has the same name as a currently open workbook.
////////////////////////////////////////////////////////////////
The data 111111111 and 22222222 was written into the excel sheet.
I think i have to open the file in the append mode as it tries to write a new file with the same name.Can anyone help me how to open the xlsx
file in the append mode
Thanks