Reputation: 41
I have a AppsScript in my Google Sheet that I want to deploy as a WebApp (something I've done many times before). I have deployed it as public (Anyone, even anonymous), and the link comes up with: "Sorry, unable to open the file at present. Please check the address and try again."
This also happens when I click "Test web app for your latest code"
The script works perfectly from within the spreadsheet, and my deployment code is:
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, ' ');
}
Any hints? Thank you!
Upvotes: 4
Views: 4140
Reputation: 62
This issue has not been fixed and still is going on. This happens when you login to multiple google account. Either logout of all, or open your link in a private tab.
Upvotes: 1
Reputation: 17613
This problem has been resolved in this github forum: Can't submit the form, Receiving "Sorry, unable to open the file at present."
And the suggested solution is to :
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
Upvotes: 2