从 Google Sheet 运行自定义函数显示无权限错误

Runing Custom Function from Google Sheet showing no permission error

我正在尝试整合 Google sheet 和 Calendar.I 已经编写了将事件添加到 google 日历的函数,但是当我尝试从 cell 使用 custom function 它显示此错误

Exception: The script does not have permission to perform that action. Required permissions: (https://www.googleapis.com/auth/calendar || https://www.googleapis.com/auth/calendar.readonly || https://www.google.com/calendar/feeds)

我已经在 Manifest file.Here 我的清单中给出了上述权限:

`

"https://www.googleapis.com/auth/calendar",
"https://www.googleapis.com/auth/calendar.readonly",
"https://www.google.com/calendar/feeds",
"https://www.googleapis.com/auth/spreadsheets.currentonly",
"https://www.googleapis.com/auth/spreadsheets"

],`

此行出现问题 let cal=CalendarApp.getCalendarById("ID");

如何解决这个问题,请帮忙!

自定义函数功能不包括日历

functionality available to Custom Functions 不包含日历。即使您将作用域添加到清单中,如果它不在 link 的列表中也没有关系,那么它对单元格或自定义函数不可用。将其编写为标准脚本并从菜单中调用它。