views:

2464

answers:

5

I need to extract data from a .mpp file on the network and combine it with other data from several different databases. The application can be written in Perl, VB6, VB.net or C# but must be easily scheduled from a Windows based server.

What would you recommend to extract the MS Project data with no user intervention?

Is there any ODBC drivers available for MS Project?

Are there any modules (for Perl, VB, VB.net or C#) for opening a .mpp and reading activity data?

+2  A: 

MPP does have its own object model that can be used to access data in it. The info should be available here: http://msdn.microsoft.com/en-us/office/aa905469.aspx

Vaibhav
+2  A: 

I would recommend using MPXJ (mpxj.sf.net) to extract data from Microsoft Project files. Don't be put off by the fact that it was originally a Java library - the current release of MPXJ includes native .net dlls as well as the original Java JAR file, thanks to the magic of IKVM.

Disclaimer: I maintain MPXJ.

Jon Iles
Thanks Jon, i've had a play and plan to try to incorporate the .NET version once released.
Mark Nold
thanks for updating this Jon. Really appreciate it.
Mark Nold
+1  A: 

I have the same need. Here is what I found so far. There is an OLEDB provider for microsoft projects, up to version MP 2007. If Google it, there are enough sites quoting the connection string, but here is the one quote: oConn.Open "Provider=Microsoft.Project.OLEDB.9.0;" & _ "Project Name=c:\somepath\myProject.mpp"

The problem with this approach seems to be that you have to install MS Project on the server. It is nuisance in any case, and an impossibility for me using hosting environtment.

So you are down to parsing .mpp. MPXJ is an excellent library as one commenter above suggests, and I can afford to wait, so I am waiting for them to release .NET version. If you are resolved to get it done, get the code and see what they are doing. Other then in their source code/comments there is no (to my knowledge) documentation of the format.

Michael
I'm in a similar situation so i have written a COM dll in VB6 which should port to using MPXJ later once i want to put in on the internets. Or get a fully hosted server at around $200/month and just install project.OLEDB seems a bit limited especially since it isn't supported in 2007.
Mark Nold
A: 

Can somebody please post a sample in C# so that I can start at least?... I am trying to make a MPP viewer in C#

        ProjectReader objReader = ProjectReaderUtility.getProjectReader(@"C:\BVContentMigrationRev2.mpp");
        ProjectFile objProject = objReader.read(@"C:\BVContentMigrationRev2.mpp");
        List<Task> tasks = (List<Task>)objProject.getAllTasks();

I did this an am stuck.... Jon Iles, Sir I think you can help...

Thanks!

+1  A: 

Hi,

Hope the following helps...

http://www.codeproject.com/KB/cs/PrjXlsRpt.aspx

Rgds