# Autofilling new Google calendar event with VBA



## RJSIGKITS (Nov 23, 2018)

Hey guys.

I have a workbook that our users register client details, and create quotations with.

We are working to a more productive way of our users working, by offering them a 'fewer clicks' solution to their daily needs of the workbook, and I would like to be able to have the users click a 'Create appointment' button that opens a Google Calendar event, and autofills the fields with information that has already been entered on the workbook, in order to prevent the need to type in the same information multiple times.

I currently have this, which successfully opens a new Google calendar event:

```
Private Sub AddActivity_Click()ActiveWorkbook.FollowHyperlink "https://calendar.google.com/calendar/r/eventedit?pli=1" & Range("c6").Value
End Sub
```

The '& Range("c6").Value' is part of my attempt to make a start, but it does nothing...

I would need the Fields to be filled with cell data as follows:
TITLE = Cell J3
LOCATION = Cell K3
TIME = Cell L3
GUESTS = Cell M3

The user can still add data to some feilds that are impossible to autofill, but Any ideas on how we can autofill as many of these as possible would be greatly appreciated.

Thanks in advance


----------



## John_w (Nov 23, 2018)

This can be done by sending XMLhttp requests to the Google Calendar API and handling the responses, but it's very involved and isn't easy.  

First you have to register your application on the Google API Console and enable the Calendar API.  Also, each request must be authorised, which means initially presenting a consent screen in IE that your user responds to.  All these steps are described at https://developers.google.com/calendar/auth.


----------

