Click here to Skip to main content
15,891,844 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends, I have html form when I click submit button .data should be moved to a excel sheet Again if I entered one more data in html form that should be appended in excel not replace !! below is the my html file in ...please help me out. I dont no how to do in javascript plz help me

What I have tried:


function mytest1()
{

var ExcelApp = new ActiveXObject("Excel.Application");
var ExcelSheet = new ActiveXObject("Excel.Sheet");
// a text is stored in the first cell

ExcelSheet.ActiveSheet.Cells(1,1).Value = "textarea1";
ExcelSheet.ActiveSheet.Cells(1,2).Value = "textarea2";

// the sheet is saved
ExcelSheet.SaveAs("C:\\Users\\s\\Desktop\\TEST.xlsx");
// close Excel with the Quit() method of the Application object
ExcelSheet.Application.Quit();

}
Posted
Updated 17-Jul-17 4:09am

1 solution

Instead of this
ExcelSheet.SaveAs
use the below code
ExcelApp.ActiveWorkbook.Save();


Refer below URL. It might help you.

javascript - Save instead of saveAs using excel activeX - Stack Overflow[^]
 
Share this answer
 
v2
Comments
Member 13313601 18-Jul-17 1:37am    
thanks

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900