0

I have created 20+ Goolge Sheets workbooks. I have also written scripting to run each one. The one thing I would love to do is instead of have 20+ codes to run in each one, I would like to have 1 code that was used throughout each of my workbooks.

Does anyone have any insite on how to make this happpen?

I have tried using the library function. I am not sure if I am doing it correctly though.

**//This is my Menu//**

function onOpen() {

var submenu = [{name: "Submit Order", functionName: "SubmitOrder"},
{name: "Recommended Order", functionName: "myRecommendations"},{name: "Clear Entire Form", functionName: "ClearAllCells"},
  {name: "Clear Product Information", functionName: "ClearProductCells"},{name: "Notifications", functionName: "showSidebar"}];
  SpreadsheetApp.getActiveSpreadsheet().addMenu('OTSR Tools', submenu); 

  }

function showSidebar() {
  var html = HtmlService.createHtmlOutputFromFile('Page')
      .setTitle('Notifications')
      .setWidth(500);
  SpreadsheetApp.getUi() // Or DocumentApp or SlidesApp or FormApp.
      .showSidebar(html);

   }

**//This is the HTML for my Sidebar//**

Hello everyone,<br>
Your quote of the week is...<br>
<br>
<i>"Our greatest weakness lies in giving up. <br>
The most certain way to succeed is always to try just one more time."</i><br>
<br>
Thomas A. Edison<br>
<br>
If there are any updates they will be found below.<br>
<br>
This is a Test!!!!!!!!!<br>
<br>
Thank you,<br>
<br>
Jason Mattson<br>
Back-End Support"<br> 
<br>
<input type="button" value="Close" onclick="google.script.host.close()" />
Rubén
  • 34,714
  • 9
  • 70
  • 166
Jason
  • 1
  • 1
    Possible duplicate of [Distributing Google Apps Scripts for Sheets in your company network](https://stackoverflow.com/questions/27567128/distributing-google-apps-scripts-for-sheets-in-your-company-network) – tehhowch Apr 03 '19 at 14:22
  • 1
    Also related https://stackoverflow.com/questions/16997274/distribute-google-apps-script-and-push-updates – tehhowch Apr 03 '19 at 14:22
  • @tehhowch Both links are too old... – Rubén Apr 04 '19 at 23:09
  • 1
    @ruben a ping goes a long way - Alan is quite active. I picked them as they both highlight add-on and library as distribution methods. – tehhowch Apr 05 '19 at 01:07

1 Answers1

1

Yes, there is. Publish is as G Suite Editor add-on. For details please read https://developers.google.com/gsuite/add-ons/overview

Related

Rubén
  • 34,714
  • 9
  • 70
  • 166