I have a test spread sheet and I have an Apps Script project linked to it.
Here is the code for Code.gs
function onOpen()
{
var testMenu = SpreadsheetApp.getUi()
.createMenu('Custom Menu');
testMenu.addItem('Show UI in sidebar', 'showSidebar');
testMenu.addToUi();
};
function showSidebar(){
var html = HtmlService.createTemplateFromFile('Page');
SpreadsheetApp.getUi().showSidebar(html.evaluate());
}
function doWorkInAppsScriptFile()
{
Logger.log("WORKING")
}
And the code for Page.html
<h2>google script run test</h2>
<div style="width:98%;margin:10px">
<div style="width:98%;margin:10px;padding:10px;text-align:center">
<input type="button" id="saveButton" onclick="onSave()" value="Save" style="background:DarkGreen;color:White;font-weight:bold;margin:10px"/>
</div>
</div>
<script type="text/javascript">
function onSave(){
google.script.run.doWorkInAppsScriptFile();
}
</script>
In Microsoft edge: the Apps Script logger shows "Status: Failed" Microsoft edge failure (Not enough rep to post image)
While when running from google chrome it shows "Completed": Google completion
I figured it out. If I sign out of all accounts, it works.