jquery - Creating xls in javascript using ActiveXObject -


my code

    var fsobj = new activexobject("scripting.filesystemobject");     var excelapp = new activexobject("excel.application");     excelapp.displayalerts = false;      var wbobj = excelapp.workbooks.add;     var wsobj = wbobj.worksheets(1); 

when use below code works fine (i.e., executes excel , fills in 2 rows)

    wsobj.cells(1,1).value="hello";     wsobj.cells(2,1).value=comparedata.response.length;     wbobj.application.visible=true; 

but when use below code says expected ';' in 3rd line (with hello), not able find problem here. here jsfiddle link, not working though, if can make work

    for(i=0;i<comparedata.response.length;i++)     {         wsobj.cells(i,1).value="hello";     }     wbobj.application.visible=true; 

row numbers in excel start 1, not 0. should write

for(i=0; i<comparedata.response.length; i++) {     wsobj.cells(i + 1, 1).value="hello"; } 

Comments

Popular posts from this blog

linux - Using a Cron Job to check if my mod_wsgi / apache server is running and restart -

actionscript 3 - TweenLite does not work with object -

jQuery Ajax Render Fragments OR Whole Page -