Problem executing CalendarApp from a Spreadsheet

36 views
Skip to first unread message

Romina Bernardo

unread,
Sep 10, 2019, 12:39:29 PM9/10/19
to Google Apps Script Community
Hi all, this is my first post here, I hope you can help me.
I wrote the following script to create a calendar event from a spreadsheet. If I run it from the script editor it works, but when I run it from the spreadsheet it doesn't. It stops right on the CalendarApp line. 

function onEdit(event){
 
var EventCal = CalendarApp.getCalendarById("exa...@gmail.com");
 
EventCal.createAllDayEvent('Apollo 11 Landing',new Date('September 20, 2019'));
}

Thank you in advance!

Dimu Designs

unread,
Sep 10, 2019, 12:46:43 PM9/10/19
to Google Apps Script Community
You probably need to use an Installable Trigger. See documentation.


Romina Bernardo

unread,
Sep 10, 2019, 1:36:08 PM9/10/19
to Google Apps Script Community
I solved it using the installable trigger as you mentioned. Thank you very much!


On Tuesday, September 10, 2019 at 1:39:29 PM UTC-3, Romina Bernardo wrote:
Hi all, this is my first post here, I hope you can help me.
I wrote the following script to create a calendar event from a spreadsheet. If I run it from the script editor it works, but when I run it from the spreadsheet it doesn't. It stops right on the CalendarApp line. 

function onEdit(event){
 
var EventCal = CalendarApp.getCalendarById("exam...@gmail.com");

 
EventCal.createAllDayEvent('Apollo 11 Landing',new Date('September 20, 2019'));
}

Thank you in advance!
Reply all
Reply to author
Forward
0 new messages