davepar / gcalendarsync

Apps Script for syncing a Google Spreadsheet with Google Calendar
MIT License
161 stars 46 forks source link

Error on Line 98 #1

Closed zebedee12345 closed 8 years ago

zebedee12345 commented 8 years ago

Hi,

After a while of searching for a way of syncing my google calendar with a spreadsheet, I finally stumbled on your script - thank god!

I think I've set it up right - I got the calendar address, and changed 'sheetName' to the name of my spreadsheet (I assume this was right? The instructions weren't too clear...). That's all I've changed.

Everything seems to run fine until the script gets to line 98, where I get the following error: Cannot find method createEvent((class),(class),(class),object). (line 98, file "Calendar Sync 1")

As I am not a programmer, I don't really have a clue where to start debugging, but any insight you can give would be appreciated!

Thanks! :)

davepar commented 8 years ago

Thanks for trying it out!

I should probably add some more error checking in the script to make sure values and formats are correct. I suspect the formatting in your spreadsheet is probably slightly different than mine. A few things to check:

Dave

davepar commented 8 years ago

I updated the script and added some error checking. There should be a pop-up dialog with a more helpful message if there are problems with the data in the spreadsheet.

zebedee12345 commented 8 years ago

Thanks for getting back to me :)

I've run the new script, and made sure my start/end time columns are in date time format, but I'm still getting an error - a different one this time, on line 73: TypeError: Cannot call method "getDataRange" of null. (line 73, file "Calendar Sync 1")

Not sure if it matters or not, but this is while trying to syncCalendar, and it's not managed to complete so far, so my spreadsheet is empty, save the column headings. Also, just checking, but my spreadsheet has a few different 'tabs' at the bottom, one of which is for the calendar - does this matter at all, or does it need to be in a separate document of it's own?

Thanks! :)

davepar commented 8 years ago

It sounds like you're trying to pull the events from the calendar to the spreadsheet. Right now the script only syncs in one direction, from the spreadsheet to the calendar. I've thought about how to go the other direction, but I haven't implemented it yet.

I modified the script slightly to just use the active sheet (tab). Previously, it was looking for a tab called "Sheet1". That error indicates it wasn't able to find that tab in your spreadsheet.

davepar commented 8 years ago

The script now syncs in both directions. I'm going to close this issue, but feel free to re-open it if you're still having problems.