Maybe a bug in MS Project 2002

  • Thread starter Troels Grosbøll-Poulsen
  • Start date
T

Troels Grosbøll-Poulsen

I am running a VB-script that inserts some actual work
values into some days at some tasks.
I use the function "TimeScaleData" to return a variable
of type "TimeScaleValues".
With this I can insert the correct values using something
like this "TSV.Item(1).value = <value>", and it works
fine in most cases.

The only problem is that sometimes when I try to insert
values into a date that is in a weekend the program
crash. It appears to me, that this only occurs in a sub
project (inserted into the plan).
It also appears to me, the type of "TSV.Item(1).value"
which is normally double "changes" to string.

I hope someone can tell me if this is a bug or that it is
just me who does not get it. If it is a bug, I hope
somebody knows a work around.

Troels Grosbøll-Poulsen
 
S

Stef Ruggiero

I have done a little work in this area and have noticed
some bugs. One is similar to what you describe.

For no apparent reason, an error can occur when assigning
to an element in a TimeScaleValues collection. I found
the error is avoided when I do not assign to a
TimeScaleValues collection element directly, but use a
TimeScaleValue object as an intermediate step. I found
processing is more stable and dependable using this
method.

Writing to an element in a collection directly (what
you're doing now):
TSV.Item(1).Value = <value>

Using an intermediate object:
Dim oTSV As MSProject.TimeScaleValue
Dim colTSV As MSProject.TimeScaleValues

Set oTSV = colTSV.Item(1)
oTSV.Value = <value>
Set oTSV = Nothing

I hope this solves your problem.
 
T

Troels Grosbøll-Poulsen

Unfortunately it did not help me; but I discovered that
the program does not always crack in the situation.
Sometimes it just writes a 0 instead of the actual value
which is not 0.
 

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