Simple Question: I would like to get the URL of the active Document (google spreadsheet) in a specific cell.
So if I enter =GetUrl() in A1 of https://docs.google.com/spreadsheet/ccc?key=XXXXXXXXXXXXXXXXXX&usp=drive_web#gid=16
should give me the result https://docs.google.com/spreadsheet/ccc?key=XXXXXXXXXXXXXXXXXX&usp=drive_web#gid=16 in the cell A1
A function like this might be useful:
function GetUrl() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
return ss.getUrl();
}
Check: Class Spreadsheet - getUrl()