title: how to pass html table values to excel sheet cells
body: <pre><code>function toExcel(tableID)
  {    
      var detailsTable = document.getElementById(tableID);
      var oExcel = new ActiveXObject("Scripting.FileSystemObject");
      var oBook = oExcel.Workbooks.Add;
      var oSheet = oBook.Worksheets(1);
      for (var y=0;y&lt;detailsTable.rows.length;y++)
      {
          for (var x=0;x&lt;detailsTable.rows(y).cells.length;x++)
          {
              oSheet.Cells(y+1,x+1) =detailsTable.rows(y).cells(x).innerText;
          }
      }
      oExcel.Visible = true;
      oExcel.UserControl = true;
  } 
  </code></pre>