What is the difference between getActive () and getActiveSpreadsheet () in Script applications?

What is the difference between the two methods from the SpreadSheetApp class in Google Apps Script?

Both return "the current active spreadsheet, or null if it is not." What is the difference between them, exactly? When should I use each of them?

+5
source share
1 answer

For me, they are completely interchangeable. Both return a spreadsheet object and have access to the methods available in the Class Table . Feel free to use what you prefer.

The same results:

Logger.log("getActiveSpreadSheet() "+SpreadsheetApp.getActiveSpreadsheet().getUrl()); Logger.log("getActive() "+ SpreadsheetApp.getActive().getUrl() ); 
+2
source

All Articles