我有一个 Google Apps 脚本,我目前正在使用它来成功打开 Google 表格电子表格(与我的帐户共享只读)并执行一些阅读功能。
我收到了另一个电子表格,我想在上面运行类似的流程。
如果我尝试:SpreadsheetApp.openById("_______")
(适用于另一张纸),我得到 Exception: Service Spreadsheets failed while accessing document with id _____"
用这张纸。这个电子表格实际上是 Google Drive 上的一个 xlsx(但似乎它仍然可以在 Google 表格中打开)而不是原生 Google 表格,所以我认为这可能是问题所在......?
所以现在我尝试使用 DriveApp.getFileById("____")
将其作为 Google Drive 文件访问。 .但是现在我收到了一个授权请求,允许我的脚本访问 Google Drive。当我授权它时,我得到:
This app is blocked
This app tried to access sensitive info in your Google Account. To keep your account safe, Google blocked this access.
我还没有找到解决这个问题的方法。我使用的是私有(private) Google 帐户,而不是使用公司的应用程序。
有任何想法吗?
最佳答案
找到了权限问题的解决方案。
为了使用 Apps 脚本,我从 @alper 的 solution 修改了它。哪些来源@tallowkrinkle 的comment .
请执行下列操作:
关于google-apps-script - 无法打开 Google xlsx 电子表格/Google Drive 权限也被阻止,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65316819/