02-03-2010, 09:17 PM
Hi All,
Please let me know if there is something wrong with this code, I keep getting a pop up message to save the file and I am given an option to save as a different file and can't append an existing file. Any help is much appreciated:
Thanks,
Mouli
Please let me know if there is something wrong with this code, I keep getting a pop up message to save the file and I am given an option to save as a different file and can't append an existing file. Any help is much appreciated:
Code:
sourcefile = [code]"\\..\..\Type_QTP.xls"
Set xlApp = CreateObject("Excel.Application")
Set xlWorkBook = xlApp.Workbooks.Open(sourcefile)
Set xlWorkSheet = xlWorkBook.Worksheets("Sheet1")
xlWorkSheet.Range("G2:G20") = "Some data"
xlWorkBook.Save
xlWorkBook.Close
xlApp.Quit
' Destroy all the Objecte references
Set xlApp = Nothing
Set xlWorkBook = Nothing
Set xlWorkSheet = Nothing
Thanks,
Mouli