5

I have 200+ spreadsheet that our customers fill. I developed a script to manage the spreadsheets which is basically identical in function.

The problem is when I modify the script I need to change it in all these sheets. I tried using libraries but with no success and I hoping to hear if someone knows an answer.

The library version I include (with development on) in each spreadsheet does not show the change ensued. It will only show the results at the time of inclusion, which means that in order to make this work I have to go to each of the spreadsheets, remove the library and re-install the most recent version. The updated library only works from my owner's account. The library is of course shared by anyone who has a link. Running a library's updated function in any of the spreadsheets produce an error: "TypeError: Cannot find function FunctionName in object [object Object]. (line 2, file "test")"

Is there a good way to have all spreadsheets same one code that I can change whenever I wish?

Nakilon
  • 34,866
  • 14
  • 107
  • 142
user2242141
  • 131
  • 1
  • 1
  • 5
  • 1
    Your library needs "Anyone can edit" sharing permission if that's not already set, but are you able to share some sample code from your library and slave scripts that isn't getting updated? – Bryan P Apr 04 '13 at 03:17
  • 1
    Seems like this is not yet possible: http://stackoverflow.com/questions/10500764/is-it-possible-to-have-one-script-for-multiple-spreadsheets – opowell Apr 04 '13 at 23:35
  • 1
    I suggest we all go star this issue: https://code.google.com/p/google-apps-script-issues/issues/detail?id=1356&q=type%3DEnhancement%20library&colspec=Stars%20Opened%20ID%20Type%20Status%20Summary%20Component%20Owner – opowell Apr 04 '13 at 23:47
  • @BryanP The script file "ManifestManager" has the following: function ShowMessage(){ Browser.msgBox("You have correct settings") } In the spreadsheet function myFunction() { ManifestManager.ShowMessage() } The output shows a message box "You have correct settings." If I deleted the entire function "ShowMessage" the reference to the library ManifestManager.ShowMessage() would still show the message box even if the function has been deleted – user2242141 Apr 06 '13 at 00:21

2 Answers2

1

You should turn on "development mode". Resources -> libraries included for each spreasheet that include the library

Andrés
  • 11
  • 3
0

I have not had much success using library myself.

One solution I would suggest would be to use a standalone script. If the spreadsheets have identical features, you can run the script on all of them using a for loop.

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

// Logs the number of files in the 'kittens' folder
 var folder = DocsList.getFolder('kittens');
 var files = folder.getFiles();
 Logger.log(files.length);
VegasFun
  • 195
  • 3
  • 13