Van*_*acK 7 google-sheets google-apps-script
我创建了一个具有特定功能的库,可以创建新的电子表格菜单(使用addMenu).我的菜单选项应该调用我的库中的其他函数来执行操作.
// Bare Minimum Deployment on a blank spreadsheet with
// my library registered (called myLibraryName for this example).
function onOpen() {
myLibraryName.setMenus(); // creating new drop-down menus
}
function onEdit(event) {
myLibraryName.doEvent(event); // sending the onEdit event to a function in my library.
}
Run Code Online (Sandbox Code Playgroud)
现在的问题是,当我选择菜单选项时,谷歌应用程序脚本会给我一个错误消息
无法找到脚本函数myMenuFunction
所以我尝试在菜单项中添加前缀
menuEntries.push({name: "About", functionName: "myLibraryName.myMenuFunction"});
Run Code Online (Sandbox Code Playgroud)
但它也没有用.
所以我要求建议如何创建一个库,该库可以创建链接到库中函数的菜单.
| 归档时间: |
|
| 查看次数: |
3126 次 |
| 最近记录: |