Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<html>
<head>
<title>sample of using Excel</title>
<script language="JScript">
var xls;
var wb;
var xlSaveChanges = 1;
var xlDoNotSaveChanges = 2;
function read_excel()
{
var rertval;
var hrng, irng;
var cols;
var rows;
var i, j;
xls = new ActiveXObject("Excel.Application");
xls.DisplayAlerts = false;
wb = xls.Workbooks.open("C:\\path to excel\\excel-test.xls");
retval = "reading data from excel:<br/>\n";
retval += "<table style=\"font:10pt MS Sans Serif\" border=\"1\" CELLSPACING=\"0\" CELLPADDING=\"1\" BGCOLOR=\"#FFFFFF\">\n";
wb.Sheets.item("Sheet1").Range("B1").value = 100;
hrng = wb.Sheets.item("Sheet1").Range("B2:F2");
cols = hrng.Columns.count;
retval += "<thead style=\"font:bold; background-color:#C0C0C0\">\n<tr>\n";
for(i = 1; i <= cols; i++)
{
retval += ("<td>" + hrng.Cells(1, i).Value + "</td>");
}
retval += "</tr></thead>";
irng = wb.Sheets.item("Sheet1").Range("B3:F22");
rows = irng.Rows.count;
for(j = 1; j <= rows; j++)
{
retval += "<tr>";
for(i = 1; i <= cols; i++)
{
retval += ("<td>" + irng.Cells(j, i).Value + "</td>");
}
retval += "</tr>\n";
}
retval += "</table>\n";
return retval;
}
function doQuit()
{
var toSave = confirm("would you like to save?");
if(toSave)
{
wb.close(xlSaveChanges);
}else
{
wb.close(xlDoNotSaveChanges);
}
xls.quit();
}
document.write(read_excel());
</script>
</head>
<body onUnload="javaScript:doQuit()">
</body>
</html>