A different set of newbie questions about MS Project

B

B. Chernick

I've spent the afternoon googling references about Dot Net and MS Project and
I'm lost. I want to try something simpler.

Given: I'm running VS2005 and I've created a VB Winforms project with a
reference to the Com object Microsoft Project 11.0 Object Library
(msprj.olb). In my form I have added the statement 'Imports
Microsoft.Office.Interop.MSProject'. Project 2003 is installed on my machine.

Given that, is it possible to write code that will (without calling up the
Project application itself) read and write to an MPP file? (Or better yet, a
Project record stored in an Access MDB file.)

Or is this a total failure of concept? (I've seen a number of examples that
seem to do approximately that but I can't get any of them to work. Am I
missing something?)
 
B

B. Chernick

Actually I finally found something that works and I suppose at a minimum this
might be good enough, but it still calls up Project itself. I was under the
impression that this interface was an alternative. (If I remember correctly,
most of the failed examples were in similar style. Unfortunately I discarded
them.) Thanks:

Dim pj As New Microsoft.Office.Interop.MSProject.Application
pj.Visible = False
pj.FileOpen(txtSourceFile.Text.ToString())
Dim tsk As Microsoft.Office.Interop.MSProject.Task
For Each tsk In pj.ActiveProject.Tasks
If tsk.Name = "Task2" Then
tsk.Notes = "Test test test again"
End If
Next
pj.FileSave()
pj.FileClose()
pj.Quit()
 
B

B. Chernick

Let me see if I understand this correctly. I did a little more hacking and
found that in Project 2003 I could save projects to SQL Server 2000 through
ODBC. I'm going to guess that it wouldn't be much of a problem to use
automation to access a project through ODBC. That alone might be acceptable
to my managers (Winforms 2.0 apps on individual machines all accessing a
central db) but what are my options for accessing the data stored in SQL
Server via a web app? (Other than Project Server 2003. How much easier
would that be?)

On the other hand, if I push for Project 2007 Server I could access the data
directly through Dot Net web apps without a need for local instances of
Project 2007? (That seems to be what the writeup is implying to me so far.
Still reading.)
 
R

Rod Gill

For accessing the data using a web app you need to ask in the appropriate
forum. Very few people in this group do web app development.

You could save as xml file from 2003 or 2007.

With Project Server 2007 team members would use Project Web Access to view
projects and provide updates. Each use would need a CAL, but they are much
cheaper than Project CALs. You can also use the PSI interface or create
reports directly from Project Server 2007's reporting database.

--

Rod Gill
Project MVP

Project VBA Book, for details visit:
http://www.projectvbabook.com

NEW!! Web based VBA training course delivered by me. For details visit:
http://projectservertraining.com/learning/index.aspx
 
B

B. Chernick

Massive apologies for not noticing your reply earlier.

The basic scenario is that we have a legacy VB6 program we want to replace.
This program calls up an instance of Project 2000, loads a blank base
project, inserts one or more other projects into the base from an Access db,
sets some dates, then does some calculations.

What we want (I think) is to write a Winforms program that does pretty much
the same thing but gets its data from SQL Server and hopfully simplifies a
great deal of spaghetti code. I think I'm a fairly decent Dot Net VB
programmer but I have absolutely no experience with Project or interop
programming, or manufacturing management terminology for that matter.

However given my current reading and testing, I'm getting more than a little
discouraged. It is my understanding that this is impossible directly through
the PSI and going through an instance of Project 2007 Pro means once again
writing Interop code.

(I was hoping to avoid all use of Interop. I've had no success at all doing
so much as a FileOpen in 2003. Also there appears to be very little
discussion out there on programming of this nature. I get the impression
this is not a common practice.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top