Sign up ×
Web Applications Stack Exchange is a question and answer site for power users of web applications. It's 100% free, no registration required.

I'm having an issue. Whenever I create a new spreadsheet, I'm not able to add a script I've already created. The list for recent projects or scripts is always blank. Anyone have a resolution or do I always have to copy the script code and insert it into the spreadsheet?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

You can add your script as a library in the new spreadsheet. Lets start from the beginning. This sample code will add a string to the active cell:

function libTest(text) {
  var sh = SpreadsheetApp.getActiveSpreadsheet()

Save the script, by creating a version:
enter image description here

Next, copy the Project Key from the script editor:
enter image description here
enter image description here

Publish the script as a web app (execute only you):
enter image description here

In the new spreadsheet, open the script editor. Chose Manage Libraries from the resources option and enter and select the key/library:
enter image description here

In the script editor you can now add the following code:

function test(){
share|improve this answer
I am not able to comment to Jacob, so I will ask here. Jacob Jan Tuinstra I got error after executing test() : function test(){ libTest.libTest("jacobjan"); } > ReferenceError: "libTest" is not defined. (line 2, file "") I deployed libTest() as library and was able to find libTest() by project key in test(). But it seems like function test() failed to find libTest() after all. Any idea what went wrong? Libraries are not experimental anymore, could this be a cause for your answer not to work? – ruslan4kad Oct 12 at 2:24

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.