Open Google Spreadsheet via Google Apps Script

后端 未结 2 904
感动是毒
感动是毒 2021-01-06 07:34

Is it possible to open a Google Spreadsheet via Google Apps script?
I\'m trying to create a way to link to a certain cell in a spreadsheet, but I can\'t manage to open

2条回答
  •  爱一瞬间的悲伤
    2021-01-06 08:18

    Found this at https://tanaikech.github.io/2018/02/20/open-site-with-new-window-using-google-apps-script/

    function myFunction() {
      var js = " \
         \
      ";
      var html = HtmlService.createHtmlOutput(js)
        .setHeight(10)
        .setWidth(100);
      SpreadsheetApp.getUi().showModalDialog(html, 'Now loading.'); // If you use this on Spreadsheet
    //  DocumentApp.getUi().showModalDialog(html, 'Now loading.'); //  If you use this on Document
    //  SlidesApp.getUi().showModalDialog(html, 'Now loading.'); //  If you use this on Slides
    }
    

    I altered the link and the window size so that it would simply open in a new tab (you could probably remove '_blank' as well...)

           \
    

    custFileID is another function that finds the file ID. Just replace that with your own variable or file ID.

提交回复
热议问题