Why am I seeing "reference error: "Calendar" is not defined" when I run a Google Spreadsheet API script?

Viewed 8683

I made a working bound script in a clone of my original Google Spreadsheet, put together over a course of several days.

I then copied my formula to a new spreadsheet.

Suddenly, even though I don't think I made any changes to any relevant code, I'm seeing "reference error: "Calendar" is not defined google API."

I have a lot of code so it would be difficult to paste it all, but the relevant section is here:

var start = (passed as argument to function);
  var end = (passed as argument to function);
  var calendarId = 'redacted'//source calendar 
  var optionalArgs = {
    timeMin: start.toISOString(),
    timeMax: end.toISOString(),
    showDeleted: false,
    singleEvents: true,
    maxResults: null,
    orderBy: 'startTime'
  };
  var response = Calendar.Events.list(calendarId, optionalArgs);
1 Answers
Related