Project Calculation Status

B

Bill Bordiuk

Is there any way to tell what a project's calculation status is? MSP must
know the status because it displays 'Calculate' on the status bar when a
duration has changed. But I can't find any way to access that information.
Ideas?
 
J

John

Bill Bordiuk said:
Is there any way to tell what a project's calculation status is? MSP must
know the status because it displays 'Calculate' on the status bar when a
duration has changed. But I can't find any way to access that information.
Ideas?

Bill,
Since you are posting in the developers group I assume your question is
related to VBA. I'm not sure what you mean by "calculation status" but
you can obviously control whether Project calculates automatically or
manually by simply setting the calculation option either manually
(Tools/Options/Calculation tab) or by setting the calculation property
in VBA. At least in VBA for Project 2003, there are also Calculate and
ProjectCalculate Events that occur after a project is calculated. They
may also be available in earlier versions, I didn't look.

As far as when project calculates? Any time there is an user action that
triggers a calculation, such as changing Duration. Some user actions
invoke instant calculation while others may start a calculation sequence
that lasts several seconds (or minutes). For example a very large file
with a lot of linkages or multiple subprojects with several external
links may take a few to several seconds to calculate all changes. The
longest calculation time I've seen was about 15-20 minutes. That was
with an older version of Project employing multiple Paste Links to
emulate external linkages.

Hope this helps.
John
 
B

Bill Bordiuk

John,

Here's what I'm trying to do: I have event code written as part of a VB6 COM
Add-In for MSP (>= 2000) that manipulates project data as part of the
Calculate event (which is only supposed to run after the project has been
calculated). Part of this code sets the Calculate mode from automatic to
manual to prevent auto-calculations from occurring while my code is running.
If the user makes a mistake and creates a loop while entering precedence
data in a split screen, an error message is produced by MSP. After the user
clicks OK to clear this message, the Calculate event is called. I don't want
my code to run at this point. In fact, the part of my code that changes the
calculation mode actually causes another calculate to occur, setting off an
infinite recusion if left unchecked. Any code that effects the Application
object at this point seems to cause a recalc. So, if I knew that the project
was 'dirty' (to use an old term), I'd know that I could exit from my calc
code. I can set up a semaphore that lets me know that I'm inside a calc
routine, but that means that my code has to be called at least once, meaning
that the user has to respond two times to the 'You've created a loop'
message. (Of course none of this would have been a problem if MS had gone
to the trouble to expose a more extensive set of events in MSP.)

Bill
 
J

JackD

Bill,

Since calculate is fraught with danger, why not use the change event
instead?
Perhaps there is some other way you can avoid this?

-Jack
 
J

John

Bill,
I don't have any suggestions at this point. I would have to do some
research (something I don't have time for right now) to find a possible
solution. Hopefully now that you have given a nice detail explanation,
one of the other guys will chime in with a suggestion.

I understand the issue about not having some objects exposed. However
even as Microsoft expands the object library, there will always be
something someone needs to do a particular procedure. Although it is
frustrating, I view it as a challenge for creative thinking to work
around the issue and to date, I have never not been able to do what I
needed with any version of Project/VBA.

John
 
B

Bill Bordiuk

The change event happens too often and there's no way (at least as far as I
can see) to tell what has changed. My code walks through the project, sets
flag and date fields, and sets the ignoreresourcecalendar flag for each
task. I can't have that happen any time the project changes. The fields I
need to update relate to views that need to be synchronized with automatic
updates.

Bill
 
B

Bill Bordiuk

So far the only solution is to supress what I want to do if I determine
that the user is in the bottom pane.

If it wasn't for all these work-arounds, I'd be out of business.
 
J

JackD

I'm not entirely clear what you mean here or what you are trying to do.
Maybe if you can describe what it is you are trying to achieve it would
help.
 

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