title: Unable to add custom menu to google sheets
body: <p>I'm writing a script that will download sheets as individual CSV's, however i cant get the script to run past 'addToUi' or 'addMenu' related. I'm operating off work servers but we permissions have been granted.</p>
  
  <p>see below snippets of code I've tried to far:</p>
  
  <pre><code>function onOpen() {
  var ss = SpreadsheetApp.getActiveSpreadsheet();
  var csvMenuEntries = [{name: "export as csv files", functionName: "saveAsCSV"}];
  ss.addMenu("csv", csvMenuEntries);
  };
  </code></pre>
  
  <p>I've also tried:</p>
  
  <pre><code>function onOpen() {
  SpreadsheetApp.getUi();
  .createMenu('Bulk Export Wok Sheets')
  .addItem('Parent Chain',SACSV);
  .addToUi();
  
  }
  </code></pre>
  
  <p>I've tried a direct copy from Apps Script Developer guide:</p>
  
  <pre><code>function onOpen() {
  var ui = SpreadsheetApp.getUi();
  // Or DocumentApp or FormApp.
  ui.createMenu('Custom Menu')
    .addItem('First item', 'menuItem1')
    .addSeparator()
    .addSubMenu(ui.createMenu('Sub-menu')
        .addItem('Second item', 'menuItem2'))
    .addToUi();
    }
  
   function menuItem1() {
   SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
   .alert('You clicked the first menu item!');
   }
  
   function menuItem2() {
   SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
   .alert('You clicked the second menu item!');
   }
  </code></pre>