Need Project 2003 COM object but not Project

B

Bob Bridges

I discovered VB/VBA/VBS only a couple years ago, and I'm trying to do a favor
for a friend who wants to write a VB tool that pulls some basic information
from a Project 2003 document. I'm tutoring him in the OO part of VB (having
just twigged to it myself), but in order to walk him through it, using
Project as our example, I need to experiment with it a little myself first.
I'm using VB 2008 Express for this purpose.

I don't have MS Project, any version, but my friend sent me an .mpp to play
with and I've found some documentation on the Project 2003 object; so far, so
good. But I'm stopped at the outset: When I try to create an instance of
that object

apProj = CreateObject("MSProject.Project")

....I'm told "Cannot create ActiveX component". I surmise the problem is
that since I don't have Project, its COM objects aren't defined in my
registry. Now, I don't have any need for Project myself and don't intend to
buy it. So my questions are

a) Am I barking up the wrong tree, or am I right that the problem is not
having a Project COM object defined in my system?

b) If I'm right about that, is there a way to get that object defined in my
system so I can experiment a bit so as to help my friend along? The
alternative seems to be to talk to him in general about working with objects
and letting him experiment on his own, which may work. But a little sample
code from me would surely help him along.
 
B

Bob Bridges

Well, I don't want to open it in Project, just handle the object in
VB-whatever. But I did expect that one way to get the object(s) defined in
my registry would be to install a trial version; I was just looking for an
easier one.

But here's the problem: It's the Project 2003 object I'm after. Can I get
a Project 2003 trial version, these days? Alternatively, is the Project 2003
object included with the 2008 trial copy?
 
J

Jan De Messemaeker

Hi,

There is no Project 2008, 2007 is bad enough
Project 2007 can open 2003 files, no problem, and the API has proactically
not changed.
Hope this helps,

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 
B

Bob Bridges

Ok, now, that's the second time you've phrased it that way. I ignored it the
first time, on the assumption that it was just a careless choice of words,
but since you repeat it let me check to be sure: I don't want to open a
document in Project 2003. I want to write a VB program to create an instance
of the Project 2003 object so I can manipulate a Project document. If that's
what you meant, or if underneath the covers they're really the same thing,
fine. But if you missed that before and now you need to change your advice
to match the new understanding, now would be a good time...?
 
R

Rod Gill

To open a .mpp file using automation you do need a project license. If you
only need to develop for a short while, then download a trial version.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 

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