I've been trying to access spreadsheets from a standalone google script, but keep getting the following error message:
Exception: Service Spreadsheets failed while accessing document with id abcdefg_example_id. (Code:25:33)
function doSomething() {
var theSheet = SpreadsheetApp.openById("abcdefg_example_id");
if(theSheet == null){
Logger.log("NO SPREADSHEET");
} else {
Logger.log("SPREADSHEET REEE");
}
Logger.log(theSheet.getName());
}
How do I access a spreadsheet by ID from a standalone google script?
Also, I've tried running the same code within a container bound script and it won't work when trying to open a different spreadsheet. Same error message. My goal is basically to access and modify other spreadsheets ideally from a standalone script but I don't mind if it has to be done another way.
I tried the same code on my PC using personal files and it works. I'm trying to get this code to work on a work computer but it runs into the issue above. I'm guessing maybe it's an authorization problem or perhaps an administrator restriction of some sort. Any ideas?
