I need to convert an excel that will be selected by the user there by display in a html table in the screen. Anyway to do this in client side using html or javascript/jquery/html5 without uploading to server?
I will get the file using an input file.
when the user clicks on upload the file data should be displayed on the html table in the same page.
I also tried the below code
function test() {
debugger
var Excel;
Excel = new ActiveXObject("Excel.Application");
Excel.Visible = false;
a = Excel.Workbooks.Open("C:/Book1.xls").ActiveSheet.Cells(l, i).Value;
//Excel.Quit()
return a;
}
//where l is number of rows and i are columns...
var i = 1;
var l = 1;
do {
a = test()
document.write("value is " + a + "\t"); i++;
if (a == "");
{
l++;
i = 1;
document.write("\n");
}
}
while (a == "");
but getting error automation server cannot create object.
I need to convert an excel that will be selected by the user there by display in a html table in the screen. Anyway to do this in client side using html or javascript/jquery/html5 without uploading to server?
I will get the file using an input file.
when the user clicks on upload the file data should be displayed on the html table in the same page.
I also tried the below code
function test() {
debugger
var Excel;
Excel = new ActiveXObject("Excel.Application");
Excel.Visible = false;
a = Excel.Workbooks.Open("C:/Book1.xls").ActiveSheet.Cells(l, i).Value;
//Excel.Quit()
return a;
}
//where l is number of rows and i are columns...
var i = 1;
var l = 1;
do {
a = test()
document.write("value is " + a + "\t"); i++;
if (a == "");
{
l++;
i = 1;
document.write("\n");
}
}
while (a == "");
but getting error automation server cannot create object.
Share Improve this question edited Oct 15, 2014 at 16:48 Tom Cruise asked Oct 15, 2014 at 16:35 Tom CruiseTom Cruise 1,42512 gold badges34 silver badges59 bronze badges 2- 1 ...and how are you getting your excel file into your browser so it can be manipulated with javascript? At present, your question lacks a lot of details and shows little effort on your part. Please show what you have tried and why it didn't work for you. – Lee Taylor Commented Oct 15, 2014 at 16:37
- If you were to use ActiveX then you will be limiting yourself to Windows and IE only. – Lee Taylor Commented Oct 15, 2014 at 16:55
1 Answer
Reset to default 2You can use http://oss.sheetjs./js-xls/ to utilize fileReader API to read xls/xlsx content as json and feed into required jquery table element.