我正在尝试根据当前选定的单元格更新 Google 表格中侧边栏的内容。我的第一个虚拟脚本是:
function onSelectionChange(e) {
var ui = SpreadsheetApp.getUi();
var range = e.range;
var selectedRow = range.getNumRows();
var htmlOutput = HtmlService
.createHtmlOutput('This is row '+selectedRow)
.setTitle('Title');
ui.showSidebar(htmlOutput);
}
Run Code Online (Sandbox Code Playgroud)
...它什么都不做,即没有侧边栏显示。我试图停用应用程序脚本 v8,没有变化。