update google calendar from access (1 Viewer)

Manolo Bueno

New member
Local time
Today, 11:44
Joined
Apr 6, 2021
Messages
1
I'm trying to schedule a meeting on google calendar from access 2019. Has anyone done this? Can you help me?
 

theDBguy

I’m here to help
Staff member
Local time
Today, 07:44
Joined
Oct 29, 2018
Messages
21,358
Hi. Welcome to AWF!

Have you looked into Google's API?
 

bastanu

AWF VIP
Local time
Today, 07:44
Joined
Apr 13, 2010
Messages
1,401
Here is what I used a long time ago to log into Google calendar (note it takes the values from a local settings table):

Code:
Private Sub vcGoogleSignIn()
Dim strURL As String, strFormData, strHeaders As String
Dim myEmail As String, myPassword As String, mySource As String, myCalendarID As String
Dim sSessionID As String, myPrivateCalendarID As String, sURL_Get As String

On Error GoTo btnAddEvent_Click_Error

myCalendarID = DLookup("[GoogleCalendar]", "[SettingsTable]")
'myPrivateCalendarID = DLookup("[GooglePrivateURL]", "[SettingsTable]")
myEmail = DLookup("[GoogleEmail]", "[SettingsTable]")
myPassword = DLookup("[GooglePassword]", "[SettingsTable]")
If myEmail = "" Then
    MsgBox "The Google email(user id)is missing - cannot sign in", vbExclamation, "Validation Error...."
     Exit Sub
End If
If myPassword = "" Then
    MsgBox "The Google password is missing - cannot sign in", vbExclamation, "Validation Error...."
     Exit Sub
End If

mySource = "MyDB Google Apps Demo"


strURL = "https://www.google.com/accounts/ClientLogin"
strFormData = "Email=" & myEmail & "&Passwd=" & myPassword '& "&source=" & mySource & "&service=cl"
strHeaders = "Content-Type:application/x-www-form-urlencoded"

DoCmd.Hourglass True
Call vcHTTP_POST(strURL, "POST", strFormData, "vcFirst")


Dim iloop As Integer
For iloop = 1 To 100
    DoEvents
Next iloop

If InStr(vcResponse, "BadAuthentication") Then
    MsgBox "Google refused logon. Confirm e-mail and password.", vbCritical, "Error"
    Exit Sub
End If

AuthCode = Trim(Right(vcResponse, Len(vcResponse) - InStrRev(vcResponse, "Auth=") - 4))
lblGoogleStatus.Visible = True


On Error GoTo 0
DoCmd.Hourglass False
Exit Sub
btnAddEvent_Click_Error:
DoCmd.Hourglass False
    MsgBox "Error " & Err.Number & " (" & Err.Description & ") in procedure AddTGoogle"
End Sub

EDIT: Sorry, you will need the attached module as well!
Cheers,
 

Attachments

  • modHttp.txt
    3.9 KB · Views: 204
Last edited:

DanielSanders

New member
Local time
Today, 15:44
Joined
Feb 23, 2020
Messages
8
I am working at the same issue. You can sync Outlook with google calendar, see youtube. If you set an appointment or task in Outlook ( with vba) it will sync automatically with G Calendar. We can work on it together? There is not si much info about using the api with vba. But that’s un option to.
 

Users who are viewing this thread

Top Bottom