您好,我贴一个Demo,里面有具体获取值的方法,
关键代码如下, Demo见附件:
- // 返回true表示允许参数含引用
- CustomFunctionWithContext.prototype.acceptsReference = function () {
- return true;
- };
- CustomFunctionWithContext.prototype.evaluate = function () {
- var arg0 = arguments[0];
- var arg1 = arguments[1];
- var row = arg1.getRow();
- var rowCount = arg1.getRowCount();
- var column = arg1.getColumn();
- var columnCount = arg1.getColumnCount();
- var source = arg1.getSource();
- var rangeCount = arg1.getRangeCount();
- var value = source.getValue(row+1, column+1);
- // The value should be 2
- console.log(value);
- return GC.Spread.CalcEngine.CalcError.parse("#Value!");
- };
复制代码
|
|