0
votes

I have Four spreadsheets one is Admin spreadsheet where all the code is written and other three are employee sheets.

So I want to call script in Admin sheet from Employee sheet using button. Whenever user clicks on button it copies data to Admin sheet.

I do not want code to be in each employee spreadsheet . I want all the code to be in Admin spreadsheet and give link to call the script from the employee spreadsheets.

I did not get solution after searching in google. Tried to use webapps but I think it is used only for HTML pages.

1
Please, refer to the official documentation on container-bound scripts. There is no "code" in any "sheets", it is just a script project associated with a specific document. Take a look at the editor add-ons - this should get you startedOleg Valter
Thanks Oleg. I am referring sheets as documents, there are four Excel docs. Is there any function like call function from different document.Sai Krishna
NP. Please, don't - Google Sheets has "Spreadsheets" which have "Sheets" in them and should not be confused. That said, no there is not - you must use a standalone script to be able to do that and it should either be deployed as a WebApp or an API executable. Btw, WebApps as a subset of web applications are not bound to render HTML pages, this is only needed if your app needs user interaction. You can use the ContentService to communicate with the WebApp server-sideOleg Valter

1 Answers

1
votes

I think that your best bet is to create an add-on.

If you are using G Suite then the add-on could be published only to be used by users from the same domain.

An add-on it's better than a library or as publishing the script as an API because these alternatives require a script to call them.

Reference