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.
3
votes
2 Answers
2
votes
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);
}