我有以下函数返回一个行数组:
/**
* Returns the names of people
* @customfunction mynames
* @param invocation Custom function handler
*/
function mynames(invocation: CustomFunctions.StreamingInvocation<string[][]>): void{
const timer = setInterval(() => {
var row1 = ["larry", "moe", "curly"];
var row2 = ["scoopy", "velma", "shaggy"];
var rows = [row1, row2];
invocation.setResult(rows);
}, 5*1000); // every 5 seconds
invocation.onCanceled = () => {
clearInterval(timer);
};
}
在 Excel 上完美运行,我得到:
larry moe curly
scoopy velma shaggy
但是,Excel for Windows 只给了我larry
. 在 Excel for Windows 中似乎不尊重溢出。
事实上,他们在文档中明确给出的示例具有相同的行为,并且在 Windows 版本的 Excel 上也被破坏了。我认为它们在 Mac 版本上也被破坏了。