我正在尝试从另一个工作表的自定义(绑定)菜单中打开Google工作表。脚本“运行”但没有打开我要打开的工作表(通过“打开,我的意思是,它们在新的浏览器选项卡中不可见)。
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Scripts')
.addItem('Open Create', 'openCreate')
.addItem('Open Perform', 'openPerform')
.addItem('Open Catalog', 'openCatalog')
.addToUi();
}
function openCreate() {
var ss = SpreadsheetApp.openById("create ID goes here");
}
function openPerform() {
var ss = SpreadsheetApp.openById("perform ID goes here");
}
function openCatalog() {
var ss = SpreadsheetApp.openById("catalog ID goes here");
}
我想念什么(做错了吗?)
答案 0 :(得分:0)
按照Casper的建议链接的指导,这是可行的。
function onOpen() {
var ui = SpreadsheetApp.getUi();
ui.createMenu('Custom Menu')
.addItem('Website', 'openSite')
.addToUi();
}
function openSite() {
var selection = SpreadsheetApp.getActiveSheet();
var html = "<a href='url'; target='_blank'>Open Site</a>";
var userInterface = HtmlService.createHtmlOutput(html);
SpreadsheetApp.getUi().showModalDialog(userInterface, 'Open Google Site');
}