Hi, How can i read values from a excel sheet dynamically using javascript.Below, I am trying to write a code.Can u please tell me where is the error made and how can i correct it.
html>
<head>

<script >
function GetData(){
var excel = new ActiveXObject("Excel.Application");
alert(excel);
var excel_file = excel.Workbooks.Open("C:\\Users\\Desktop\\javascript\\Subdivision.xlsx").ActiveSheet;
alert(excel_file);
var totalRows =excel_file.UsedRange.Rows.Count;
alert(totalRows);
for(var i=2;i <= totalRows;i++){
var data = excel_file.Cells(i,3).Value;
document.getElementById('div1').innerText =data;
}
}
</script>
</head>
<body>
<div id="div1" align="center">
Click buttons to fetch data
</div>
<input type="button" value="cell,row" onclick="GetData();" />

</center>
</body>
</html>