Events.RemoveCalendar
---------------------

Removes a calendar from the database.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [Events](component_Events.md) | [6.2](newinversion62.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ✅ Yes |

MBS( "Events.RemoveCalendar"; EKCalendar { ; Commit } ) 

**MBS**( **"Events.RemoveCalendar";** /\* Removes a calendar from the database. \*/  
**$EKCalendar**; /\* The identifier or name of the calendar.e.g. $calendar \*/   
**$Commit**) /\* Optional; Whether to commit.  
Pass 1 to commit or 0 to not commit.  
Default is 1.  
Pass 0 to batch changes together and commit with [Events.Commit](EventsCommit.md) later.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| EKCalendar | The identifier or name of the calendar. | $calendar |  |
| Commit | Whether to commit.   Pass 1 to commit or 0 to not commit.   Default is 1.   Pass 0 to batch changes together and commit with [Events.Commit](EventsCommit.md) later. | 1 | Optional |

### Result

Returns OK or error.

### Description

Removes a calendar from the database.  
This function attempts to delete the given calendar from the calendar database. It returns OK if successful and error otherwise.   
If the calendar supports multiple entity types (allowedEntityTypes), but the user has not granted you access to all those entity types, then we will delete all of the entity types for which you have access and remove that entity type from the allowedEntityTypes. For example: If a calendar supports both events and reminders, but you only have access to reminders, we will delete all the reminders and make the calendar only support events.  
If you have access to all of its allowedEntityTypes, then it will delete the calendar and all of the events and reminders in the calendar.  
  
You may still need to call [Events.Commit](EventsCommit.md) later.  
### See also

- [Calendar.RemoveCalendar](CalendarRemoveCalendar.md)
- [Events.Commit](EventsCommit.md)
- [Events.Item.GetCalendar](EventsItemGetCalendar.md)
- [Events.Item.SetCalendar](EventsItemSetCalendar.md)
- [Events.NewCalendar](EventsNewCalendar.md)
- [Events.RemoveReminder](EventsRemoveReminder.md)
- [Events.SaveCalendar](EventsSaveCalendar.md)

This function checks for a license.

Created 10th March 2016 , last changed 17th March 2021

  
[Events.Reminders](EventsReminders.md) - [Events.RemoveEvent](EventsRemoveEvent.md)

[HTML Version](EventsRemoveCalendar.shtml)