0
votes

I have just returned to do some maintenance on Google sheet scripts I wrote last year and I can't get in to debug them from the Sheet's Tools -> Script editor command. When I try, Google opens up the standard "Access Denied" - "Request Access" error page. The same problem seems to affect every Sheet I have with an embedded script. I suspect this is a side-effect of being upgraded to the new scripting API.

I can still run the scripts normally and they operate as expected.

I can open the scripts from the new API Console and I can edit them successfully from there. However if I try to run the scripts with the debugger from the API console, I get an immediate error when the script tries to access the Sheet data it looks like the SpreadsheetApp.getActiveSpreadsheet is not returning a useful value (debugger says "select active spreadsheet first"). I would guess that the same problem that prevents the Script editor working from the Sheet is also preventing the API debugger working properly.

I am sure the code itself is fine as it works without the debugger.

1

1 Answers

0
votes

Surprisingly, just after posting this question I seem to have found the answer. It appears that the Google Sheet's Tools -> Script editor command used my default (home) Google account, even though I was logged into my work account and had successfully loaded the Sheet which I can only access from my work account.

Problem resolved by logging out of both my Google accounts and logging back in with my work account. I think this must be some sort of Google Bug.