Excessive delay when updating 'TimeScaleData' via automation

From: WGHayes (hayes_at_nospam99-please.com.au)
Date: 09/08/04


Date: Wed, 8 Sep 2004 13:09:25 +0930

Dear Reader,

We have an application which is updating 'Forecast' and 'Time***' data
into MS Project 2002 using automation for analysis purposes. Our
application has options to update either:- Work, BaselineWork or Actual work
depending on what the circumstance and requirement is.

We are using the 'TimeScaleData' method as follows (example for updating
WORK value):-

----
MSProject.Application.ActiveProject.Tasks.UniqueID(nnn).Assignments.UniqueID
(nnn).TimeScaleData(StartDate:=strStartDate, EndDate:=strEndDate, Type:=8,
TimeScaleUnit:=4, Count:=1).Item(1).Value = dblHours
(Note:- where, nnn, strStartDate,  strEndDate, dblHours are passed in).
---
We are also creating/updating all resource and calendar information (i.e. we
are actually creating a NEW MS Project for each analysis run that we do and
LOAD all the data required).  This means we are using our own employee
calendars and NOT the Microsoft standard calendars.
We have noticed that on occasion there is a significant delay in performing
an update using this method for a single timephased assignment entry (over
20 seconds on a reasonably spec'd machine - P3-500, 512MB Ram).  We have
narrowed the problem down to issues with the working calendar for resources.
If a resource is NOT available on the day for which we are updating 'ACTUAL
WORK' then MS Project just freezes.  However, this is not always the case.
It seems to depend on other resources and assignments already created for
the TASK that we are adding and assignment for?
If we open the MS Project interactively and manually EDIT/ADD the records
(i.e. repeat the steps that would have otherwise be performed via
automation) the problem does not exist.
My questions are:-
Q1- Has anyone had a similar performance/freeze issue?
Q2- What is MS Project actually doing that could cause an excessive delay
(i.e. project recalculate, changing other assignment entries, other???)
Q3- How could I debug the problem further? (i.e. in the DEBUG window when I
step through the line of code it just freezes for 20 seconds -how can I
debug this?)
Any advice of feedback on this would be appreciated.
Regards,
WGH.