How do you open an Excel workbook using JavaScript for Automation?
let excelApp = Application("Microsoft Excel");
let path = Path("/Users/me/Test.xlsx");
excelApp.openWorkbook(path);
gets error 50 "parameter error".
I figured it out:
let excelApp = Application("Microsoft Excel");
let testWorkbook = excelApp.openWorkbook({workbookFileName: "/Users/me/Test.xlsx"});
I also figured out how to get the contents of the data:
let varr = testWorkbook.sheets["firstsheet"].usedRange.value();
source: Yosemite JXA release notes and Script Editor dictionary entry for Microsoft Excel