Google-sheets – Run script when clicked on picture in published Google spreadsheet

google sheetsgoogle-apps-script

I used the script underneath in Google Spreadsheet and added an image that when clicked upon runs the GOTOSHEETONE function to navigate to sheet: SHEETONE.

So far so good. However, when I publish my document this function is not executed anymore. A link to a Google form, which is also in my document, does work when published. Is there a way to make this function also run in published document mode?

function showSheetByName(Name) {
   var ss = SpreadsheetApp.getActiveSpreadsheet();
   var sheet = ss.getSheetByName(Name);
   SpreadsheetApp.setActiveSheet(sheet);
}

function GOTOSHEETONE() {
   showSheetByName("SHEETONE");
}

Best Answer

Is there a way to make this function also run in published document mode?

The short answer is, unfortunately, no. The published version of a spreadsheet has many functional limitations, and this is one of them.