Hello everyone,
I'm encountering a very persistent and unusual permission issue with my Google Apps Script, and I'm hoping to get some help.
1. My Goal: I am trying to create an Apps Script that reads data from one Google Sheets file (my sales record) and then generates invoices in a different Google Sheets file (an invoice template).
2. The Problem: When the script reaches the SpreadsheetApp.openById() line, it consistently returns the following error: **Exception: Specified permissions are not sufficient to call SpreadsheetApp.openById. Required permissions: https://www.googleapis.com/auth/spreadsheets**
3. What I've Tried: I have tried the following troubleshooting steps, but none have resolved the issue:
The authorization pop-up window **does appear** when I first run the script.
I have clicked "Review permissions" and successfully granted all requested permissions, including the one for https://www.googleapis.com/auth/spreadsheets.
After I click "Continue", the script immediately fails with the same error. It does not proceed to execute any further code.
I have tried creating a brand new Apps Script project in a new, empty Google Sheets file, but the problem persists.
4. Relevant Code: The line of code causing the error is: **const salesSpreadsheet = SpreadsheetApp.openById(salesSpreadsheetId);**
5. Additional Information: The authorization pop-up appears and I confirm that I grant the permission. The error occurs right after authorization, without any code execution. I am using a personal Google Account.
Has anyone else experienced a similar issue, and if so, what was the solution? Thank you for your time and help!
--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-script-community/542f1aa7-1a5b-45b9-9c11-1fdf4751784cn%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "Google Apps Script Community" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-apps-script-community/fIzkmlRvLyc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/google-apps-script-community/CAFKgK%2BE%2B0tiPAModiUUY04UbrJ1HXYb4YMFpYMOzH2uiiTKumA%40mail.gmail.com.
--