获取调用我的自定义函数 officejs excel 加载项的单元格的地址

问题描述

是否可以从 excel JS API 中获取调用我的自定义函数的单元格的地址?

当我像这样在自定义函数中使用调用参数时:

/**
 * Return the address of the cell that invoked the custom function. 
 * @customfunction
 * @param {number} first First parameter.
 * @param {number} second Second parameter.
 * @param {CustomFunctions.Invocation} invocation Invocation object. 
 * @requiresAddress 
 */
function getAddress(first,second,invocation) {
  var address = invocation.address;
  return address;
}  

我收到错误:由于@requiresAddress 存在,最后一个函数参数应该是 CustomFunctions.Invocation 类型

OBS:我使用的是共享运行时。

开发环境:Windows 10、office 365 MSO (16.0.13929.20222) 64 位、Edge 版本 90.0.818.51 最新、Vs Code 与 Yeoman 生成器、Excel 桌面、共享运行时。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)