google apps script - Error msg from custom function when trying to open another spreadsheet. "You do not have permission to perform that action." -


i have custom function want use retrieve cell value in sheet spreadsheet. 2 parameters of function row , col , determine cell reference. whenever try use function, error "you not have permission perform action.", pointing line openbyid method. here custom function:

function test(row,col) {     var formdataspreadsheet = spreadsheetapp.openbyid(form_data_spreadsheet_id);     spreadsheetapp.setactivespreadsheet(formdataspreadsheet);     var formdatasheet = formdataspreadsheet.getsheetbyname(website_form_data_sheet_name);     formdataspreadsheet.setactivesheet(formdatasheet);     return formdataspreadsheet   } 

do need publish form_data_spreadsheet? appreciated.

sorry, can't in custom function:

quote google documentation:

if custom function throws error message "you not have permission call x service.", service requires user authorization , cannot used in custom function.

google documentation - custom functions


Comments

Popular posts from this blog

c# - Better 64-bit byte array hash -

webrtc - Which ICE candidate am I using and why? -

php - Zend Framework / Skeleton-Application / Composer install issue -