[Javascript] Excel API

John Warner john at jwarner.com
Sat Nov 11 03:40:16 CST 2006


Consider upgrading to Visual Studio 2.0  Dotnet is the upgrade path from
classic ASP.
 
 
John Warner

-----Original Message-----
From: javascript-bounces at LaTech.edu
[mailto:javascript-bounces at LaTech.edu] On Behalf Of vijaykumar bavareddy
Sent: Saturday, November 11, 2006 2:23 AM
To: javascript at latech.edu
Subject: [Javascript] Excel API


function ToExcel()
            {
            if (window.ActiveXObject)
            {
            var  xlApp = new ActiveXObject("Excel.Application"); 
            var xlBook = xlApp.Workbooks.Add(); 
            xlBook.worksheets("Sheet1").activate;
            var XlSheet = xlBook.activeSheet;
            xlApp.visible = true; 
            var hdrcol=document.getElementsByName("hdrcol"); 
            var nRowsCount=pshipGrid.getRowsNum();
            var nColCount=pshipGrid.getColumnCount();
            for(var P = 1; P<=nRowsCount ; P++)
            {
            for(var Q = 1; Q < nColCount; Q++) 
            {
            if (P==1)
            {
            XlSheet.cells(P ,Q).value =  hdrcol.item(Q).innerHTML;
            }
             var cell=pshipGrid.cells(P,Q);
             XlSheet.cells (P +1,Q).value = cell.getValue(); 
            }
            }
            XlSheet.columns.autofit; 
            }
            }//end function 

Hi above code am using to create Excel document for grid data using
javascript and Activex object.. but problem is i just want do this
without using Activex object( Excel.Application).. and it should work in
both IE and FF in Windows OS..


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.evolt.org/pipermail/javascript/attachments/20061111/409ac0bf/attachment.htm>


More information about the Javascript mailing list