0

I have already got the code to create a ui in spreadsheet with the link that user can click like this:

function testNew(){
  showAnchor('Google','http://www.gogole.com/');
}

function showAnchor(name,url) {
  var html = '<html><body><a href="'+url+'" target="blank" onclick="google.script.host.close()">'+name+'</a></body></html>';
  var ui = HtmlService.createHtmlOutput(html)
  SpreadsheetApp.getUi().showModelessDialog(ui,"demo");
}

But, I DO NOT want to create a UI within google sheet.

I am looking for a simple way to simply open a URL in browser tag from google sheet script. How can I do that?

Already tried this but this is not working in google sheet script

window.open("https://www.google.com");

Is there any way to simply open a URL in browser?

kuml
  • 231
  • 5
  • 15
  • You have to create UI within google sheet to access client side script to open new browser tab. Otherwise you will operate only by means of server side script. Browser is essentially client side... – Александр Ермолин Apr 05 '19 at 07:26
  • Have you tried this https://stackoverflow.com/a/54675103 ? `window.open()` works for me. – TheMaster Apr 05 '19 at 08:23
  • Possible duplicate of [Google Apps Script to open a URL](https://stackoverflow.com/questions/10744760/google-apps-script-to-open-a-url) – TheMaster Apr 05 '19 at 08:24

0 Answers0