 <p>An installable onOpen will probably be the best solution since your <code>onOpen</code> function needs authorization to run (access spreadsheet Service).</p> <p>Just change the function name to avoid double firing.</p> <p>sample code from your example :</p> <pre><code>var ss = SpreadsheetApp.getActiveSpreadsheet(); var activeSheet = ss.getActiveSheet(); function installableOnOpen() { insertEmptyRow(); var menuEntries = [ {name: "My Menu", functionName: "myFunction"} ]; ss.addMenu("First menu", menuEntries); } function insertEmptyRow(){ if(activeSheet.getRange(3, 5).getValue() !== '') { activeSheet.insertRows(3); Logger.log("activeSheet.getRange(3, 1).getValues() = " + activeSheet.getRange(3, 1).getValue() ); } } </code></pre> <p><a href="https://docs.google.com/spreadsheets/d/164qJ8xjwuSrh6Qn7WFGVvdKQgrQA2XwCDugq0pwjv7U/edit?usp=sharing" rel="nofollow">test spreadsheet with view rights, make a copy to use and/or modify.</a></p>