I need to read some cell values from a .xls file using JScript under WSH.
Is there any COM object or anything that I can use to do that?
Actually there is a COM component for this. Its progId is "Excel.Application" and you use it like this:
var XLS = WScript.CreateObject("Excel.Application") ;
XLS.Workbooks.open(xlsFile) ;
var cellValue = XLS.Cells(row,col).Value ;
That's it. As simple as that. The variable cellValue
now holds the value in the cell (row
,col
).
And if that's not good enough, xlsFile
may be the path to a file or a URL (yes, a URL!, great isn't it).