I have this formula that extracts the link from a word with hyperlink. Now when I'm trying to move it to another spreadsheet and run it I get an 'Exception: Range not found' error. I was reading this might be cuz I need a 'getRangeList' insted of getRange, but it doesn't work this way either. Now I get the 'Exception: The parameters (number) don't match the method signature for SpreadsheetApp.Sheet.getRangeList.' Here's the code I'm using:
function URL(refrence) {
var sheet = SpreadsheetApp.getActiveSheet();
var formula = SpreadsheetApp.getActiveRange().getFormula();
var a1 = formula.replace("=url(","");
a1 = a1.replace(")","");
var url = sheet.getRange(a1).getRichTextValue().getLinkUrl();
return url
}