Search code examples
ms-officeoffice-interopms-project

Programing for MS Project 2013


I'm a bit confused about what I can use to develop for: It's a soup of letters: VBA, VSTO, Interop, etc... I'm in need in develop a MS Project 2013 control. So, what can I use to develop it? I prefer develop in C#, but if it isn't possible, I can develop VBA anyways...


Solution

  • Maybe I can help a little bit with the soup of letters. VBA is the oldest technology in your list. It is primarily used for scripting (automating) things in MS Project based on old visual basic operations on the MS Project object model. It typically works inside a specific MS Project file. VSTO is the modern version of VBA that Microsoft introduced to take advantage of .NET. It is still file-centric, but now you can use a modern object-oriented language like C# or VB.NET to write your control. A third approach is to write a separate .NET application that can work with any MS Project file. An example of this is the COM-Addin approach. A COM Addin is C# or VB.NET application that you compile and package separately. Then you register the Add In on the machine so that MS Project knows about it and calls it when needed.

    Both VSTO and COM Addins are written in .NET, whereas MS Project only speaks COM. Thus both rely on the Microsoft COM-Interop libraries when they talk to MS Project. These libraries are called 'Primary Interop Assemblies' and they enable the translation between COM calls and .NET calls.

    There's a comprehensive book on all of this by Andrew Whitechapel called Microsoft® .NET Development for Microsoft Office. It's no longer sold directly on Amazon, but you can still find it through other sellers. I've left out a few other related techniques that you can find in Andrew's book. Another expert is Rod Gill. He's written a book called VBA Programming for MS Project '98 through 2010 with an Introduction to VSTO. It's more VBA-centric than Andrew's book, but you may find it helpful. I'd recommend that you Google Andrew and Rod and also Misha Schneerson, formerly at Microsoft. Both Andrew and Misha have moved on to other technologies now, but you'll find that they give you good cookbooks for doing this sort of thing.

    Hope this helps.