Get active excel workbook object in javascript -


currently code running is:

var excel = new activexobject("excel.application"); var excel_file = excel.workbooks.open("filepath"); var excelsheet = excel_file.activesheet; var noofsubs = excelsheet.cells(24,3).value; 

excel.workbboks.open commands opens excel file. how reference open excel file? maybe

var excel_file = excel.activeworkbooks.activate("excelfilename"); 

typically you'd use getobject() if there's instance of excel running , want reference that. note though if there >1 instance running, 1 can't controlled script.

https://msdn.microsoft.com/library/7tf9xwsc%28v=vs.94%29.aspx

var xl;  try  {     // existing instance running ?     xl = getobject("", "excel.application");  }  catch(e)  {     // excel wasn't running: start new instance     xl = new activexobject("excel.application");  }  

Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -