Tips and tricks

Find some VBA and VSTO tips and tricks not included in the book or help further explain what is already in the book. Please email me if you any requests.

Creating an add-in for different versions of Microsoft Project

Each add-in can only target one version of Project, so if you want to target Project 2007 and 2010 then you need two add-ins. It is possible to create one add-in for both versions, but only by buying an add-in for Visual Studio such as Add-in Express.

You can develop an Add-in for Project 2007 then copy it and ammend it to handle the Ribbon for Project 2010. However, every time you make a change to one version you would need to duplicate the change in the other copy. This inevitably leads to much confusion and maintenance time and cost. There is another way:

Create one project to hold the basic add-in and one project for each version of project. Include the basic add-in project in each version then reference the basic project so you can call code in the basic project from the menu or ribbon. Now changes to the basic code are available for each version and your maintenance problems just went away!

Cumulative % complete for Timescaledata method doesn't work

There were some minor bugs in the Project 2010 Object model for Project 2010. All these have been fixed by Service Pack 1 for Project 2010.

FileOpen and some other methods don't raise an error if the method fails

There were some minor bugs in Project 2010 VBA for Project 2010. All these have been fixed by Service Pack 1 for Project 2010.

We recommend for:
  • Project 2003: Service Pack 3. This lets you read Project 2007 format files (but not Project 2010 files). Note after installing SP3 under Tools, Options and the Security tab be sure to select the "Allow loading files with legacy or non default file formats" option so you can open more than just Project 2003 format files.
  • Project 2007: Service Pack 2 plus all cumulative updates. Set the legacy file format setting as above.
  • Project 2010: Service Pack 1 plus all cumulative updates.
  • To solve VBA crashes with Project 2010 install teh following hotfix:
    KB2596585

Download all Service packs and Cumulative Updates free from www.microsoft.com