ContributionsMost RecentMost LikesSolutionsRe: Saving an Excel file I do have few files name (resume.xlw) but none of them are open. the only application that open at the time of run the test is testcomplete & SQL server The script I am using, I found it online. below is sample of script I used of course with my modification to fit my settings Function Main() { var ConnectionString = “DRIVER = SQL Server; SERVER=H_kptest; UID=aaa; PWD=aaa”; var TableName = “ListofOrders”; var ExcelFilePath = “C:\Book1.xls”; var SheetName = “sheet1”; ExportTbaleToExcelFile(ConnectionString, TableName, ExcelFilePath, SheetName); } Function ExportTbaleToExcelFile (ConnectionString, TableName, ExcelFilePath, SheetName) { //Creates a new connection var connDB = ADO.CreateConnection(); connDB.ConnectionString = connectionString; connDb.Open(); //opens a record set var Tbl = connDB.Execute(“SELECT * FROM” + TableName); //opens an Excel file var MsExcel = Sys.OleObject(“Excel.Application”); MsExcel.Workbooks.Open(ExcelFilePath); var Sheet = MsExcel.Sheets(SheetName); MsExcel.Visible = true; //copies field Names for (var i=0; i< Tbl.Fields.Count; i++) Sheet.Cells(1, i+1).value = Tble.Fields.Item(i).Name; //scans all records returned by the query Tbl.MoveFirst(); var RowIndex =2; while (! Tbl.EOF) { For (i=0; i < Tbl.Fields.Count; i++) Sheet.Cells(RowIndex, i + 1).Value = Tbl.Fields.Item(i).Value; Tbl.MoveNext(); RowIndex++; } //closes the Excel File MsExcel.Save(); MsExcel.Workbooks.Close(); //Closes the recordset and the connection Tbl.Close(); connDB.Close(); } Saving an Excel file Hey I need help saving an excel file. I am using Jscript. I have a script that connects to DB and runs a query and copies that result in specified excel sheet. But when I try to save the excel using “MsExcel.Save();” Excel give me an alert about another excel file “A file named ‘RESUME.XLW’ already exists in this location. Do you want to replace it?” The file ‘RESUME.XLW’ has nothing to do with this script. Im not sure why I keep getting this alert? Can someone please help????