Error in TimeScaleData Calculations

G

Guest

I've got a .Net integration project where we are accessing the project
file through COM Interop. I need to pull out all the tasks, resources,
assignments, etc. At the moment, I'm trying to pull out the assignment
resources, calculated to the month.

I've pulled the resources on a particular task and "calculated" the
timscaledata for each assignment with the statements:

mWork=mAssign.TimeScaleData(mAssign.Start, mAssign.finish,
Project.PjAssignmentTimescaledData.pjAssignmentTimescaledWork,
Project.PjTimescaleUnit.pjTimescaleMonths)

I then try to cycle through each month with a for next loop to write
out the data:

For iCnt=1 to mwork.Count
mwork(icnt).startdate
mWork(icnt).enddate
mwork(icnt).value
Next

I'm trying to test it on a assignment that lasts 11 months, but it
currently is dying on the third month (either way, I've tried from 1 to
count and from count to 1 step -1).

The additional problem is that that this is causing the project file to
change, because I'm grabbing the active project from the open instance
of MS Project 2003.

Any help would be appreciated,

Michael Schnell
 
J

Jan De Messemaeker

Hi,

I cannot reproduce the problem.
I run similar code in VBA using debug.print to show the data and it's OK.

The next part of your question is super puzzling.
Your code doesn't update anything so why would the project file change?

But ... if you try to update these worek values in a simple loop like
thosone that copuld explain..
You cannot put work for nonworking days!
That may explain why it "stops".

HTH
 
G

Guest

I'm actually trying to get the data out of project into an xml file for
further processing.

On each of those lines, I'm writing the value out to an xml node.

I'm doing this inside a VB.Net project and getting the application from
GetObject(,"MSProject.Application") while I have Project Pro 2003
running. After I get the first error, then the data inside the open
project file starts changing.

Again, any help is appreciated,

Michael Schnell
 

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