Click here to Skip to main content
15,890,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
C#
function exportToExcel() {
//    debugger;
//
//
//            //copy innerHTML of YourTable to strCopy Variable.
//
//         //   var strCopy = document.getElementById("Htm1").outerHTML;
//            var strCopy = document.getElementById("Htm1").innerHTML;
//            // clickExcel

//            //getElementById("Bdy1").innerHTML;
//            //copy strCopy to clipboardData, this

//            window.clipboardData.setData("Text", strCopy);

//            var objExcel = new ActiveXObject("Excel.Application");

//            objExcel.visible = false;
//            var objWorkbook = objExcel.Workbooks.Add;
//            var objWorksheet = objWorkbook.Worksheets(1);
//             objWorksheet.Paste;
//
//
//             document.execCommand("saveas");
//
//            objWorksheet.SaveAs("C:\\anil.XLS");
//            alert("file is saved on c:");
//         //   objWorksheet.close();
//
//    }
Posted
Comments
Naz_Firdouse 23-Apr-14 7:26am    
what is the problem?
[no name] 23-Apr-14 8:22am    
post what error you are getting in details

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