3

When I run my google app script, which used to work fine, I keep getting the error message

"This document is too large to be edited offline. Go online to resume editing."

After this message, I close the Google sheet and try to reopen but it won't let me for about 10 minutes. I have no idea why this is happening and how to fix it. Can anybody help me?

I think the problem is caused by the following code that shifts rows down and inserts a row at the top of a Google Sheet:

  sheetLog.insertRows(2, 1);//shift all rows down (in history) by length of log
  sheetLog.getRange(2,1,1,logResults[0].length).setValues(logResults);
Rubén
  • 34,714
  • 9
  • 70
  • 166
  • Do you have many rows and columns in your spreadsheet? Moreover, can you post the full error message? – ale13 Nov 30 '20 at 10:47
  • 1
    I have the same problem and it's very frustrating! The sheet becomes inaccessible after a big operation (for me it's setValues) which used to work fine for years. There is an issue about this [here](https://issuetracker.google.com/issues/156530211), you could star it so the Google team takes notice. I have seen this error message and others indicating the spreadsheet has become unreachable. Here is a [link](https://stackoverflow.com/questions/64977032/google-apps-script-setvalues-issue-timing-out-intermittently) to my issue. What function are you using in your script? – Ninca Tirtil Nov 30 '20 at 14:25
  • The message that pops in Google Sheets in a red dialogue box says "This document is too large to be edited offline. Go online to resume editing." I don't have many rows but I think the problem might get generated when writing a single row to the spreadsheet. – Aaron Lieben Nov 30 '20 at 17:32
  • I think the problem occurs with the following code that is used to shift rows down in a table and insert a new row at the top. Is there a different way I should be doing this? It has been working for months now but now creates intermittent problems. sheetLog.insertRows(2, 1); sheetLog.getRange(2,1,1,logResults[0].length).setValues(logResults); – Aaron Lieben Nov 30 '20 at 19:07
  • What are you getting when you do this: `Logger.log(sheet.getMaxRows())`, `Logger.log(sheet.getDataRange().getLastColumn())` and `Logger.log(sheet.getDataRange().getLastRow())`? – ale13 Dec 08 '20 at 08:27

0 Answers0