Read Excel data (cell)
I'm trying and trying and I just can't. Please I need to read/display a specific c开发者_运维知识库ell in my html just like another text. I'm using this:
function readData()
{
var excel=new ActiveXObject("Excel.Application");
var book=excel.Workbooks.open("http://142.116.39.71/Produ.xls");
var sheet=book.Worksheets.Item(1);
/*var data=sheet.Cells(x,y).Value;
var data=book.ActiveSheet.Cells("");
return data();*/
excel.quit();
excel.application.quit();
excel = null;
book = null;
sheet = null;
CollectGarbage();
}
value=readData("E,18");
//var value=readData("E18", "E18");
document.write("Value from Excel file is "+value);
BUT..... I have this: Value from Excel file is undefined
Your function is not returning any value. Uncomment the code and correct the code to be return data;
and not return data();
and you're not passing by the arguments to the function readData(x,y) and you're not declaring variable "value" var value = readData("E","18");
multiple syntax error
精彩评论