Creating a new MS Project file from Access

G

Guest

Hoping someone can help me out here. I've developed an Access database to
help manage property development projects. The clients have since decided
that they would like to tie the database in with MS project, which they are
currently using to manage the scheduling for these projects. I understand
that I can save an MS Project file as an Access database and then link that
data to the data in my database file. I'd like the user to be able to create
a new project record in my Access database and then have it automatically
create the new project file in MS Project and subsequently save that new file
to the Access database that contains their other MS Project projects.

I've referenced the MS Project Object Library in my Access database, but am
unsure as to how to proceed. I can't seem to find any documentation on the
relative commands, etc.

Can anyone give me the proper code to create a new project in MS Project
from MS Access??

Any help would be greatly appreciated!

Janelle
 
G

Guest

Try this....

Private Sub PrjTest()
Dim appPrjApp As MSProject.Application
Dim prjPrj As MSProject.Project

'Open Project and make it visible
Set appPrjApp = CreateObject("msproject.application")
appPrjApp.Visible = True

'Create a new Project
appPrjApp.FileNew
Set prjPrj = appPrjApp.Projects(1)

'Next you can add whatever you need to the project, using the tasks,
resources etc collections.

End Sub

This should at least get you started....
Hope this helps,

Peter Lilley
 
G

Guest

.....also, don't forget to add a reference to the Project Library, otherwise
the code will not work....

In the modules screen select Tools > References and check the box next to
"Microsoft Project x.x Project Library" x.x is the version of the library
currently installed on your pc, you need to have Project installed on your pc
or access to the library file.
 
Joined
Aug 2, 2010
Messages
2
Reaction score
0
More...

Now what would be the next step after this?The code provided:
Private Sub PrjTest()
Dim appPrjApp As MSProject.Application
Dim prjPrj As MSProject.Project

'Open Project and make it visible
Set appPrjApp = CreateObject("msproject.application")
appPrjApp.Visible = True

'Create a new Project
appPrjApp.FileNew
Set prjPrj = appPrjApp.Projects(1)

opens a new Project document, but how do I populate it with fields from the Access database?
 

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