Reputation: 4122
I made a lot of functions to use in google docs spreadsheet.
I also saved this script as version 1. I also made a deployment and it got installed as an add-on. But this does not appear in Add-ons.
I also made a new script file not associated with a spreadsheet and pasted in same code.
I can import it as a library into another spreadsheet and use functions in script, but I can not use functions in spreadsheet cells.
eg. if library has a function pc_rand(), I want to put '=pc_rand()' into a cell. Or, '=lib.pc_rand()'
How do I to use this script in another google docs spreadsheet?
Upvotes: 1
Views: 85
Reputation: 201378
I believe your goal as follows.
In order to achieve your goal, I would like to suggest to use a Google Apps Script library. When the script of Spreadsheet "A" is used as the Google Apps Script library, the same result with the Spreadsheet "A" can be obtained at the Spreadsheet "B" by calling the script from Spreadsheet "B".
But, from your replying, there is an important point for this. When you want to use the functions in Spreadsheet "A" for the Spreadsheet "B" as the custom functions, unfortunately, in the current stage, =pchatalib2.pc_rand()
cannot be directly used. (In this case, it supposes that pchatalib2
and pc_rand()
are the library identification and the function of the library, respectively.) So, in this case, it is required to create a function in the script editor of Spreadsheet "B" as follows.
const pc_rand = () => pchatalib2.pc_rand();
By this, when =pc_rand()
is put in a cell, the function of Spreadsheet "A" can be run at the Spreadsheet "B".
Upvotes: 1