Hi guys im trying to display a sidebar on my google sheets every time it is opened. I am using the onOpen function and calling the html page, but it is not executing. When i run the function manually it works, however it doesnt execute on its own when the google sheet is opened. Here is my code:
.gs code:
function onOpen(){
var html = HtmlService.createHtmlOutputFromFile('tipA')
.setWidth(300);
SpreadsheetApp.getUi() // Or DocumentApp or FormApp.
.showSidebar(html);
}
.html code:
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div>
<p> Some text <p>
<p><img src="some link" alt="xyz" width=240 height=210></p>
</div>
</body>
</html>