for (var i = 0; i < detailsTable.rows.length; i++) { for (var j = 0; j < detailsTable.rows(i).cells.length; j++) { oSheet.Cells(i + 1, j + 1) = detailsTable.rows(i).cells(j).innerText; } } oSheet.Range("A" + i, "Z" + i).WrapText = true; oSheet.Range("A" + 1, "Z" + i).EntireColumn.AutoFit();
oExcel.Visible = true; oExcel.UserControl = true; }