Question

What are my options for programmatically accessing a Microsoft Project file? What are the pros and cons of each approach?

I will basically need to import all data from the file into another data structure. Using the Office Interop assembies is low on the preference scale.

Was it helpful?

Solution

Here are the options:

  1. Interop (messy and horribly slow for large projects)
  2. Save project in XML and work with it (messy)
  3. Save project in the database (that's not publishing and it is available for project 2003 only - see ODBC option while saving). I've seen it being used a lot in the integration scenarios
  4. Projette (commercial, $10 per license)
  5. ILog Project Viewer (also commercial)

OTHER TIPS

The MPXJ (mpxj.sf.net) library comes in both Java and .Net flavours and will allow you to read and write multiple Microsoft Project file formats using a single consistent API. I am aware of commercial products which use both the Java and the .Net versions of MPXJ without any issues.

Disclaimer: I'm the maintainer of MPXJ.

You may use Aspose.Tasks for .NET. This component allows you to work with Microsoft Project files. It doesn't require MS Office to be installed on the server, unlike Office Interop. The API is very simple and easy to use. And it provides a rich set of features to read, edit, write, and convert MPP files.

This component is a normal .NET assembly which can be used with your .NET applications. It works on any Windows OS and in 32/64-bit environments as well.

Disclosure: I work as developer evangelist at Aspose.

The Microsoft Office API provides programmatic access to MS Project. I have only used it for Word and Excel so I don't know how rich the interface is - you will have to do some digging around on MSDN to find out what you can and can't do.

One of the Java projects at my company uses a commerical product by Aspose which allows applications to manipulate Office documents including Project. It works well for their purposes, but again, they have only used it for Word and Excel so can't offer much advice on Project.

EDIT (2019): I can confirm that it is a very capable product.

Sourcefourge.net offers a component in Java which can be integrated with .net applications to read MPP files upto MPP 2007 the link is http://mpxj.sourceforge.net/getting-started.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top