I have a spreadsheet with twelve sheets, one for each month of the year. I'd like to have the sheet matching the current month set as the active sheet by default whenever the spreadsheet is opened.
Seems easy enough:
function onOpen() {
var today = new Date();
var ss = SpreadsheetApp.getActive();
ss.setActiveSheet(ss.getSheets()[today.getMonth()]);
}
Unfortunately, SpreadsheetApp loads the first sheet (January) first, then loads the sheet I want. On some mobile clients, this results in an unacceptably long load time.
Is there a way to hook into the sequence before the first sheet in the spreadsheet is loaded as the active sheet?