r/GoogleAppsScript • • Sep 29 '26

Question Google Apps Script authorization blocked / loop after adding PropertiesService and hitting execution time limit

I'm running into a frustrating authorization issue with a Google Apps Script in a Google Sheet, and I could really use some help figuring out what's wrong.

Here is the context:

  1. Initially, when I tried to run the script, I got an authorization prompt, but there was no button to grant authorization. I posted in the Google Community, and someone advised me to add /** u/OnlyCurrentDoc */ at the very beginning of the script. After doing that, it worked without any issues.
  2. Later, I made numerous additions to the script. Eventually, I hit the execution time limit (6 minutes).
  3. Google Gemini suggested adding PropertiesService to the code to save the current state (such as the active sheet, row, and color index) so the script can pause safely before hitting the limit and automatically resume where it left off.
  4. After implementing this, I am now getting a prompt to authorize the script again, but the warning message blocks me completely with the error: "This app is blocked. This app tried to access sensitive info in your Google Account." Unlike standard unverified app warnings, there is no "Advanced" link to bypass it.

Troubleshooting steps I’ve already tried:

  • I temporarily turned off Advanced Protection Program on my account and waited a while, but I still get the warning blocking the authorization.
  • I tested the exact same script on a secondary test Google Account, and I was able to authorize and run it completely without issues.

My questions:

  • Why is this happening on my main account while the test account works fine?
  • Do I need to wait hours (or days) for turning off Advanced Protection Program to fully take effect, or is something else causing this block?

Any advice would be greatly appreciated!

1 Upvotes

2 comments sorted by

View all comments

Show parent comment

1

u/mommasaidmommasaid Oct 01 '26

I'd also recommend trying to get your script below the 6 minutes rather than messing with all the complexity regarding a multi-stage calculation.

Very commonly, scripts do cell-by-cell calculations with interleaved getValue() and setValue() calls.

If you are doing that, you can typically dramatically speed up the script by doing one large getValues() on your entire range of data, manipulating the resulting array, and writing it back with one setValues().

Share your code if you want more specific optimization suggestions.