![](/img/trans.png)
[英]Exception: Service Spreadsheets failed while accessing document with id google sheet
[英]Exception: Service Spreadsheets failed while accessing document with id *** / getsheetname()error I think
很久以前我的 onEdit() function 工作沒有任何問題,但突然停止工作。 spreedshet 給我錯誤的行是: var sheet = SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getSheetName();
例外:訪問 ID 為 ************ 的文檔時服務電子表格失敗
我不知道發生了什么
代替
SpreadsheetApp.getActiveSpreadsheet().getActiveSheet().getSheetName();
經過
SpreadsheetApp.getActiveSheet().getSheetName();
或通過
SpreadsheetApp.getActiveSheet().getName();
您認為導致問題的行可能不是正確的行,因為錯誤表明問題是您正在通過 id 訪問文件並且需要權限https://www.googleapis.com/auth/drive
但 onEdit是一個簡單的觸發器,不能執行需要權限的操作。 嘗試移動到可安裝的觸發器。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.