I've got the following script running on a Google Spreadsheet:
function FORMATCURRENCY(value, currency) {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheets()[0];
var range = sheet.getRange("D19");
range.setNumberFormat("$#,##0.00;$(#,##0.00)");
return range
}
But when I run it I get an error saying "You do not have permission to run setNumberFormat".
I've looked into the documentation for this function here and I've followed all the instructions, including adding the authorization dependencies on the scope properties in the script area and I still get the same error.
My manifest file looks like so in the scripts:
{
"timeZone": "Europe/London",
"dependencies": {
},
"exceptionLogging": "STACKDRIVER",
"runtimeVersion": "V8",
"oauthScopes": [
"https://www.googleapis.com/auth/spreadsheets",
"https://www.googleapis.com/auth/spreadsheets.currentonly",
"https://www.googleapis.com/auth/spreadsheets.readonly",
"https://www.googleapis.com/auth/userinfo.email"
]
}
What is the problem here?