MS Access-MS Project Automation

D

DanRoy

I am writing an Access Appliocation where I want to read selected fields in
MS Project and save to a table in MS Access. I have extensive experience
working with the project Object model and developed a Windows application
using automation with MSProject, being able to both rad and write data. I
found the following KB article,
http://support.microsoft.com/kb/210014
and was able to get this to work.

To extrapolate from this, I want to read several MS Project fields and save
them to an Access table, with the unique ID being the key field between MS
project and this Access table. I realize I need to save the duration and
task type so that when I write data back where the duration changes and I can
temporarily change the task type to Fixed Units and allow the resource to
vary as the duration varies, then restore the task type back to its original
setting.

Can you provide several lines of code which demonstrates how MS Project
field data may be saved to Microsoft Access table fields. Sine I am using
the Unique ID as a key field, I will need to update all non-key field data if
the access table already contains the particular task, or i will need to
eprorm an Add if the Unique ID does not exist in the Access table.
 
D

DanRoy

Thank you for responding but I am working with a desired implementation. We
do not have MS Project Server available to us.

I have included a snippet of the code i am trying to make work.

Function fncProjectOLE()
Dim dbs As Database, rst As DAO.Recordset
Set dbs = CurrentDB
Set rst = dbs.OpenRecordset("Project_Mirror") // name of table

Dim prjApp As MSProject.Application
Dim prjProject As MSProject.Project
Dim intTask As Integer
Dim strProj As String
Dim StrSelect As String
Dim StrCriteria As String

Set prjApp = CreateObject("MsProject.Application")

prjApp.FileOpen "C:\Test\Project2.mpp", ReadOnly:=True
prjApp.Visible = True

'Run a macro.
prjApp.Macro "Toggle_Read_Only" 'Toggle file back to read-write.

For intTask = 1 To 4
DoCmd.GoToRecord acDataTable, "Project_Mirror", acGoTo, intTask
rst!ECP_Reference = "New"
rst!TaskName = prjProject.Name
strProj = prjProject.Application.Name
Next intTask

prjApp.SelectColumn
prjApp.FontItalic True 'Change font properties.
prjApp.EditGoTo 5, Date 'Go to a specific cell in the column.
prjApp.FileClose pjDoNotSave
prjApp.Quit

Set prjProject = Nothing
Set prjApp = Nothing
End Function



I started out with the KB article referenced in the original request for
help and modified it to this. What I am trying to do is read a Microsoft
Project task's UniqueID and Name fields and save to the Access table with
corresponding names.

Can you offer any suggestions as to how I can do that using the code above?
The above code is not saving the data read from MS Project into the Access
table.

Thanks

Dan
 
S

scutzer

Did you ever find a solution for this?

I'm working on something similar and was thinking that I would just grab the
data from the MS Project Object Model and use SQL to insert the data into the
table.

I'll post my results if you are still in need?
 

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