我试过了:
table.selectionRange = table.ranges["C6:C7"];
获取:错误 -1728:无法获取对象。
我可以使用表格对象:例如:table.rowCount();
有任何想法吗?
注意:语法'table.selectionRange = table.ranges["C6:C7"];' 已在此处作为解决方案发布:如何使用 JXA 在 Numbers (iWork) 中创建范围
为进一步清晰添加:
Logger.logInfo("#Rows " + table.rowCount());
Logger.logInfo("Current Range " + table.selectionRange.name());
Logger.logInfo("#Cols " + table.columnCount());
table.selectionRange = table.ranges["C6:C7"];
Logger.logInfo("New Range " + table.selectionRange.name());
给出:
/* 2018/02/02 @ 19:36:27.020: Info : BlockPriceUpdateYPF: #Rows 34 */
/* 2018/02/02 @ 19:36:27.023: Info : BlockPriceUpdateYPF: Current Range C5:G31 */
/* 2018/02/02 @ 19:36:27.025: Info : BlockPriceUpdateYPF: #Cols 15 */
Result: Error -1728: Can't get object.