How to use one code for several spreadsheets that can be updated, try using the library

I have a 200+ table that our customers fill out. I developed a script for managing spreadsheets that are basically identical in function.

The problem is that I am modifying the script. I need to modify it in all of these sheets. I tried to use libraries, but to no avail, and I hope to hear if anyone knows the answer.

In library version I, which includes (with development) in each spreadsheet, the change is not shown. It will only show results during power-up, which means that to complete this work, I have to go to each of the spreadsheets, delete the library, and reinstall the latest version. The updated library only works with my owner account. Of course, the library is shared by everyone who has the link. Running the updated library in any of the spreadsheets causes an error: "TypeError: cannot find the FunctionName function in the [object Object]. (Line 2, file" test ")"

Is there a good way to have all the spreadsheets of the same code that I can change when I want?

+5
source share
2 answers

You must enable "development mode". Resources -> libraries included for each sheet containing library

+1
source

I have not had much success in using the library.

One solution I would suggest would be to use a stand-alone script. If the tables have the same functions, you can run a script for all of them using the for loop.

You can get an array of files inside a folder using getFiles ()

// Logs the number of files in the 'kittens' folder
 var folder = DocsList.getFolder('kittens');
 var files = folder.getFiles();
 Logger.log(files.length);
0
source

All Articles