2

I'd like to do some basic matrix operations in google app script. I tried the solution to copy-n-paste math.js found in this thread: Matrix Operations in Google Script

But when I try to paste the code to the script file from inside my google spreadsheet, it always hangs. I tried pasting portions at a time, but it always hangs when I reach the end. I'm wondering if the file is too long for google script. Fairly new to google app scripting, so any help would be appreciated!

1 Answers1

0

It is a possible reason that you have exceeded the maximum execution time in Google Apps Script. From this thread, you could set up a time driven trigger to run the script every five minutes(or create a trigger programmatically using the Script service).

Also, based from this link, try to minimize the amount of calls to google services. For example, if you want to change a range of cells in the spreadsheets, don't read each one, mutate it and store it back. Instead read the whole range (using Range.getValues()) into memory, mutate it and store all of it at once (using Range.setValues()).

Additional reference: Google Spreadsheet freezes when done running App Script

abielita
  • 13,147
  • 2
  • 17
  • 59