【问题标题】:Web app doesn't deploy: Sorry, unable to open the file at presentWeb 应用未部署:抱歉,目前无法打开文件
【发布时间】:2018-05-20 06:03:18
【问题描述】:

我的 Google 表格中有一个 AppsScript,我想将它部署为 WebApp(我以前做过很多次)。 我已将其部署为公共(任何人,甚至匿名),并且链接出现: “抱歉,目前无法打开文件。 请检查地址,然后重试。”

当我点击“为您的最新代码测试网络应用”时也会发生这种情况

脚本在电子表格中完美运行,我的部署代码是:

    function doGet() {
  return HtmlService.createTemplateFromFile('Weekly.html')
      .evaluate();
}

function onOpen() {
  var Menu = SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
      .createMenu('Survey');
      Menu.addItem('Run Survey', 'doSurvey')
        .addToUi();
}

function doSurvey() {
  var html = HtmlService.createTemplateFromFile('Weekly.html')
      .evaluate();
  SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
      .showModalDialog(html, ' ');
}

有什么提示吗? 谢谢!

【问题讨论】:

    标签: google-apps-script google-sheets web-applications


    【解决方案1】:

    此问题已在此github forum 中解决:无法提交表单,接收“抱歉,目前无法打开文件。”

    建议的解决方案是:

    just remove the user part of the URL should work too, e.g. for the OP:
    
    https://script.google.com/macros/s/AKfycbyO4vXIPrq4smOSFpUzyQSuOxvJE9YWqlND6GfyZ3Y2lR-pPMk/exec
    
    we should add this to the tutorial, I suppose. also relevant for some gsuite users:
    https://stackoverflow.com/questions/26153872/cant-make-a-google-apps-script-publish-for-anonymous-users
    

    【讨论】:

      【解决方案2】:

      此问题尚未解决,仍在继续。当您登录多个谷歌帐户时会发生这种情况。要么全部注销,要么在私人标签中打开您的链接。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-12-31
        • 1970-01-01
        • 2019-01-21
        • 2013-07-14
        • 2018-05-06
        • 2018-05-23
        • 2016-04-23
        相关资源
        最近更新 更多