sheetCalendarSync
Google App Script for synchronizing Excel
AI Summary
Sheet Calendar Sync
Enables two-way sync between Sheets and Calendar.
Target Users
Beginner GAS developers managing calendar events via Sheets.
Problems Solved
Cumbersome manual calendar event management without Sheets integration.
Script ID
- In GAS Editor: Click "Libraries +" → Paste into "Script ID" field → Click "Look up"
- "sheetCalendarSync" will appear in the search results
- Select the latest version (highest number) from "Version" dropdown
- Click "Add"
Tags
Main Features
1
Structured Sheet Creation
Auto-creates sheets with columns like Event ID, Last Synced, Title, Times, Description.
2
Fetch Events
Fetches calendar events to sheet. Optional date range; requires empty sheet except headers.
3
Sync Changes
Syncs rows with Update=Y to calendar. Uses threshold to limit API calls.
Examples
Main Functions
| Function | Description |
|---|---|
| SheetCalendarSync.createSheetWithColumns | Creates sheet with predefined columns |
| SheetCalendarSync.fetchEventsToTable | Fetches events from calendar to sheet |
| SheetCalendarSync.syncWithCalendar | Syncs sheet changes to calendar |
Examples
Create Structured Sheet
/**
* 構造化シートの作成
* ・シート名設定: const sheetName = "GCal Event Sync";
* ・関数定義: function createSheet() {
* ・ライブラリコール: SheetCalendarSync.createSheetWithColumns(sheetName);
*/
function createSheet() {
const sheetName = "GCal Event Sync";
SheetCalendarSync.createSheetWithColumns(sheetName);
}Fetch Calendar Events
/**
* カレンダーイベント取得
* ・設定値定義: const calendarId = "your-calendar-id@group.calendar.google.com";
* ・関数定義: function fetchEvents() {
* ・ライブラリコール: SheetCalendarSync.fetchEventsToTable(sheetName, calendarId);
*/
function fetchEvents() {
const sheetName = "GCal Event Sync";
const calendarId = "your-calendar-id@group.calendar.google.com";
SheetCalendarSync.fetchEventsToTable(sheetName, calendarId);
}Sync Sheet Changes
/**
* シート変更の同期
* ・設定値定義: const syncThresholdMinutes = 5;
* ・関数定義: function syncWithCalendar() {
* ・ライブラリコール: SheetCalendarSync.syncWithCalendar(sheetName, calendarId, syncThresholdMinutes);
*/
function syncWithCalendar() {
const sheetName = "GCal Event Sync";
const calendarId = "your-calendar-id@group.calendar.google.com";
const syncThresholdMinutes = 5;
SheetCalendarSync.syncWithCalendar(sheetName, calendarId, syncThresholdMinutes);
}