I have a textbox and a button on a html page. On click of button I want to save the value in the textbox to a particular cell of the excel file
I have written the following code
var ExcelSheet = new ActiveXObject("Excel.Application"); ExcelSheet.Workbooks.Open("D:\\TEST.XLS"); // Make Excel visible through the Application object. ExcelSheet.Application.Visible = false; // Place some text in the first cell of the sheet. ExcelSheet.ActiveSheet.Cells(2,1).Value = document.forms.txtName.value ; // Save the sheet. ExcelSheet.Save(); ExcelSheet.DisplayAlerts = false; // Close Excel with the Quit method on the Application object. ExcelSheet.Application.Quit(); // Release the object variable. ExcelSheet = "";
Everything works fine. The value is stored in excel but when I click the button to save I am getting a message
"A file named 'RESUME.XLW' already exists in this location. "
I have also written
ExcelSheet.DisplayAlerts = false;
But still I am getting the message.
Why this message is coming and what is the way to supress it.