google spreadsheet - error - "Method Range.getValue is heavily used by the script" -



google spreadsheet - error - "Method Range.getValue is heavily used by the script" -

i posted question did not tag (and hence why did not answer) thought give shot haven't been able find reply in meantime.

the below script giving me message in title. have function using same getvalue method running fine. can alter in script avoid issue?

function trasholdfiles() { var ffile = spreadsheetapp.getactivespreadsheet().getsheetbyname("ctrlsht").getrange("b3:b3").getvalue(); var files = driveapp.getfilesbyname(ffile); while (files.hasnext()) { var file = files.next(); var latestfile = driveapp.getfilebyid(listlatestfile()); if(file.getid() ==! latestfile){ file.settrashed(true); } } };

is error or execution hint(the lite bulb in menu)?

are using method on other part of code? in listlatestfile()? got same execution hint calling getrange().getvalue() in listlatestfile() (using loop) , hint mentioned problem when calling

var ffile = spreadsheetapp.getactivespreadsheet().getsheetbyname("ctrlsht").getrange("b3:b3").getvalue();

in function trasholdfiles() when actual problem in other function.

check if calling in other place in code, within loop.

google-apps-script google-spreadsheet

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -