在单元格中插入 Google 电子表格 ID
Inserting Google Spreadsheet ID in cell
正在尝试将电子表格 ID 的值和 sheet/tab 个 ID 插入我电子表格的单元格中。
找到这个答案并尝试将代码作为脚本:
How to fetch the ID of a Google Spread Sheet via Google Apps Script?
然后当我尝试 运行 它作为基于单元格的函数时 运行 进入这个错误:
Error You do not have permission to call msgBox (line 2).
根据 No permission to call msgBox in Google Apps Scripting.
希望可能有解决方法and/or正确的方法来做到这一点,有人可以指出。
当使用自定义函数将值写入单元格时,您可以直接使用return
将值写入单元格。
所以你修改后的函数是
function getId() {
return SpreadsheetApp.getActiveSpreadsheet().getId()
}
正在尝试将电子表格 ID 的值和 sheet/tab 个 ID 插入我电子表格的单元格中。
找到这个答案并尝试将代码作为脚本:
How to fetch the ID of a Google Spread Sheet via Google Apps Script?
然后当我尝试 运行 它作为基于单元格的函数时 运行 进入这个错误:
Error You do not have permission to call msgBox (line 2).
根据 No permission to call msgBox in Google Apps Scripting.
希望可能有解决方法and/or正确的方法来做到这一点,有人可以指出。
当使用自定义函数将值写入单元格时,您可以直接使用return
将值写入单元格。
所以你修改后的函数是
function getId() {
return SpreadsheetApp.getActiveSpreadsheet().getId()
}