Updating Google Calendar with MS Project Tasks


Have an updated version of this writeup at https://www.ashishpaliwal.com/blog/2011/07/updating-google-calendar-with-ms-project-revisited/

I am back, as promised. Please read my earlier post Processing Microsoft Project File in Java using MPXJ.

In this post we shall take an mpp and update the Google Calendar with the task details. The question is why would anyone do that? 

Lets cook the story. A small team is working and the poor Project Manager share the Schedule with the team. The team is so busy coding that they forget to look at the dates, and the tasks they must be starting on. The poor Project Manager himself loose track unless he keeps MS Project Open on his desktop 🙁 A pretty common situation 🙂 

Have faced this situation and decided to organize myself and this post is outcome of that. The driving force was “Out of sight, is out of mind”. So my assumption was if the team has a visual of the task dates, the chances of task slippage shall reduce a lot. 

In this post, have built upon the my previous post to create an MPP parsing function. Have tried to keep the code in simplest form, so that it can customized later to specific needs. Have created a sample Schedule for this activity and used it for the implementation. Here is how it looks.


Google Calendar updater Project Schedule

Google Calendar updater Project Schedule

The schdule is simple, some date, and tasks with dependencies. The concept shall work for any number of tasks.

Following are the steps that we need to perform:

  1. Parse the mpp file
  2. Create a Calendar Service (Lets assume that the Calendar is already there, though it is possible to programmatically create the same)
  3. Get All tasks from MPP, and create Calendar Entries in Google Calendar
The Code
Google Calendar Entry Creation Code

Google Calendar Entry Creation Code

The implementation is fairly simple. We have 3 functions:

  • translateTaskToCalendarEventEntry() – Converts an Task into CalendarEventEntry, which can be added to Google Calendar
  • updateCalendar() – Takes input of all the Tasks from MPP, translates into CalendarEventEntry (using function translateTaskToCalendarEventEntry) and update the Calendar
  • updateGoogleCalendarWithMPP() – Parses the MPP using the util function from my previous post, and calls the API above to update the Calendar.

Google Calendar API usage is described in details on Google’s pages, hence won’t discuss here.
To use it for yourself, replace User Name and Password at line#70, with your User Credentials. Repace the URL at Line# 71 to point to your calendar.
After running the program, this is how my Calendar looked like 

Google Calendar View
Google Calendar View

A simple way to keep track of Tasks.

11 thoughts on “Updating Google Calendar with MS Project Tasks

  1. Hi, that’s great!
    how do I get the full code?
    I mean a file with everything I need to use the wonderful thing you did? except from libs, off course.

  2. Hello. It’s a very interesting thing what you did here… A little question though… How do I update a shared google calendar if I am the poor project manager, who has several employees?
    Thanx a lot for any help you can give me.

  3. Hi, I’m a non programmer 🙁

    but would like to use this code

    could someone by an absolute star and create an executable that I can run ?

    so it takes the mpp file and your google calender login and which calender you want to sync with

  4. I went everywhere looking for a program that I could just put a Microsoft Project file in and get anything else out so that I could try to get it to my Google Calendar easily.

    And after failing miserably, I settled on your code here. It wasn’t good enough for me though, so I spent two days writing this tool that does just a little bit better for me.

    If anyone wants the fruits of our labor, there’s an app for that now. 🙂

    Just head over here if you want to download it: http://daball.github.com/Microsoft-Project-to-Google-Calendar/

    Thanks for figuring it out!

    David Ball

  5. Well, Ashish,

    I am a late entrant to the mpputils but thanks a lot for this utility.

    Though I’m facing a problem in exporting my MS Project Tasks to google calendar.

    The time of the task is being imported at GMT i.e. -5:30 hrs from Indian Standard Time.

    Can this be addressed to? How?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.