Problem with retrieving an array of chart classes in google apps scripts

Viewed 30

So for months my scripts have run just fine when grabbing charts from an google sheets, but as of three days ago they all just started throwing the exception "Service Spreadsheets failed while accessing document with id blahblah." I can't find any sign of them updating the chart class or spreadsheet class and changing format either. Here's a general example of the format I use for my scripts when grabbing charts:

function main(){
  var sheet = SpreadsheetApp.openById("blahblah").getSheetByName("Sheet 1");
  var charts = sheet.getCharts();
  for(var i=0;i<charts.length;i++){
    sheet.removeChart(charts[i]);
  }//end 1st for loop
}//end main

It has run perfectly for months, but now no matter what I try to do, it won't allow me to do the method .getCharts() from a spreadsheet. Any help is appreciated.

I found where others have reported similar problems: https://issuetracker.google.com/issues/182701055 and https://issuetracker.google.com/issues/156530211.

1 Answers

What you are experiencing might in fact be a bug and it has already been reported on Google's Issue Tracker here.

I suggest you star the issue and eventually add a comment mentioning that you are affected by it.

Related