问题描述
试用Google电子表格中的新库功能。我已经包含一个标识为Test的库,并且库实现了函数foo()。在电子表格单元格中输入= Test.foo()错误:未知函数名称TEST.FOO
如果我在电子表格中创建一个函数来封装库函数:
函数foo()
{
return Test.foo();
}
然后在我的speadsheet单元格中使用= foo(),一切正常。为所有库函数创建封装函数,以便它们可以在电子表格单元格中使用,这使得使用库不够理想。有没有办法从电子表格单元调用库函数?
目前还没有办法直接调用这些库函数作为一个单元格的自定义功能。正如你所做的那样,创建一个包装是目前的方法。如果您希望能够直接以自定义功能调用库函数,请将其作为。
Trying out the new library feature in a Google spreadsheet. I have include a library with the identifier of "Test" and the library implements the function "foo()"
entering =Test.foo() into a spreadsheet cell gives the error : "unknown function name TEST.FOO"
If I create a function in my spreadsheet to wrap the library function:
function foo()
{
return Test.foo();
}
then use =foo() in my speadsheet cell, all is well. Creating wrapper functions for all library functions so they can be used in a spreadsheet cell makes using libraries less than ideal. Is there a way to call a library function from a spreadsheet cell?
There's not currently a way to call these library functions directly as a custom function from a cell. Creating a wrapper, as you've done, is the way to do this currently. If you'd like to be able to call library functions directly as custom functions, please raise that as an issue on the Issue Tracker.
这篇关于从Google电子表格单元调用Google App脚本库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!