Forum Post: Retrieving data from excel

Status
Not open for further replies.
M

mflanegan

Guest
Hi, I am trying to extract data from an excel file and the following script only works on IE. Is there a generic process available that will work on IE,chrome,FireFox and mozilla? Here is the code I currently have: html head title Style Get data from excel sheet /title script language="javascript" function GetData(cell,row){ var excel = new ActiveXObject("Excel.Application"); var excel_file = excel.Workbooks.Open("C:\\Temp\\names.xlsx"); var excel_sheet = excel.Worksheets("Sheet1"); var data = excel_sheet.Cells(cell,row).Value; document.getElementById('div1').innerText =data;*/ window.open('C:\\Temp\\names.xlsx', 'excel');. } /script /head body p /p div style="background: #009955; width:'100%';" align="center" font color="#000080" size="12pt" b Get data from excel sheets /b /font /div center p /p div id="div1" style="background: #DFDFFF; width:'100%';" align="center" Click buttons to fetch data from C:\\Temp\\names.xlsx /div input type="button" value="cell(1),row(1)" onClick="GetData(1,1);" / input type="button" value="cell(1),row(2)" onClick="GetData(1,2);" / input type="button" value="cell(2),row(1)" onClick="GetData(2,1);" / input type="button" value="cell(2),row(2)" onClick="GetData(2,2);" / /center /body /html

Continue reading...
 
Status
Not open for further replies.
Top