Control Project From Excel

T

Taras

(Sorry if it's posted twice - service seemed to crash
when I hit the Send key)
I'm creating a report in Word based on information in
Excel and MS Project. Most of the information is
contained in Excel so I'm using that as the base for the
macros.

I can't find any way of opening an MS Project file from
Excel. (I have both load on my PC). There is nothing in
the OLE Programmatic Identifiers in VB Help on MS Project.

I have included the MS Project 9 Object Library in Excel
under Tools.References (should it be higher in the
priority?)

Can anyone point me in the right direction?

TIA
 
D

Dick Kusleika

Taras

The priority should not make a difference. Here's a short example of how to
open a project file and read the name of the first task. It sounds like you
already have the reference set, but if not, set it before you run this macro

Sub GetProjectData()

Dim prApp As MSProject.Application

Set prApp = New MSProject.Application
prApp.FileOpen "C:\My Documents\CBSENIOR.mpp"

MsgBox prApp.ActiveProject.Tasks(1).Name

prApp.FileClose pjDoNotSave
prApp.Quit

Set prApp = Nothing

End Sub
 

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