5

Is it possible to customise the toolbar of a Google Spreadsheet/Sheets by adding a custom icon linked to a script/macro? I have only seen customised spreadsheet menus.

antonio
  • 10,629
  • 13
  • 68
  • 136

2 Answers2

3

Presently this isn't possible. The current set of methods on the Spreadsheet object does not include any facility to access the toolbar or add a new one.

You are limited to either adding a menu, sidebar or defining custom functions.

I myself resided to using a menu item to toggle a sidebar, much in the way described here:

function onOpen() {
  SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
      .createMenu('Custom Menu')
      .addItem('Show sidebar', 'showSidebar')
      .addToUi();
}

function showSidebar() {
  var html = HtmlService.createHtmlOutputFromFile('Page')
      .setTitle('My custom sidebar')
      .setWidth(300);
  SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
      .showSidebar(html);
}
Paul Lammertsma
  • 37,593
  • 16
  • 136
  • 187
1

Its not possible with apps script but you can write a browser extension to do so. Of course users would need to install it too.

Zig Mandel
  • 19,571
  • 5
  • 26
  • 36