|
Microsoft Usenet > > > Different Finish date in VBA than shown in MS Project itself
View Full Version : Different Finish date in VBA than shown in MS Project itself
mwetzel@buffnet.net 06-13-2007, 02:38 AM Under certain conditions, I receive a different task finish date in
VBA than MS Project shows in the application itself. The date in VBA
is about 4 days later. It seems to happen when the task has a Finish
on type constraint. Actually, if I look at the constraint date in VBA
it too is the later date. How can I determine the same date in my VBA
application that MS Project shows? What is causing this to happen?
Jan De Messemaeker 06-14-2007, 09:43 PM Hi,
Not having seen this happen for the last decade, I hav problem believing
it.
In Project, aren't you looking at a different field than finish?
Baselinefinish maybe?
Greetings,
Jan De Messemaeker, Project MVP
<mwetzel@buffnet.net> wrote in message
news:1181698689.894053.179560@n15g2000prd.googlegroups.com...
> Under certain conditions, I receive a different task finish date in
> VBA than MS Project shows in the application itself. The date in VBA
> is about 4 days later. It seems to happen when the task has a Finish
> on type constraint. Actually, if I look at the constraint date in VBA
> it too is the later date. How can I determine the same date in my VBA
> application that MS Project shows? What is causing this to happen?
>
mwetzel@buffnet.net 06-20-2007, 03:16 PM After further investigation, I've determined that this only happens
under a certain set of circumstances. First, the default start time
and end time must not be set. By that I mean that they must be left
at 12:00am for both start and end time in the project options under
calendar. Then, a constraint must be set for a task with a date only
and no time. In my case it was a Finish no earlier than 6/22/07.
When I read back the constraint date in VBA, it says 6/26/07 1:13:30
PM. If I specify the time when I specify the constraint, then
everything works as it should. If I set the default finish time to
4:00 PM, then everything works as it should if I then specify the
constraint date without a time.
It is almost as if the save date:time for the constraint is faulty
when their is no valid time entered or no valid default time. I could
be that the time field is larger than 1 day. Could it possibly be 4.5
days?
Jan De Messemaeker 06-20-2007, 06:19 PM I repeated your steps exactly (2003, Professional, SP2) and behold, there is
an anomaly in the bar drawing but VBA Immediate window give me the exact
date and time for the constraint date and the finish date!
--
Jan De Messemaeker
Microsoft Project MVP
http://users.online.be/prom-ade
<mwetzel@buffnet.net> wrote in message
news:1182349000.974812.297660@o61g2000hsh.googlegroups.com...
> After further investigation, I've determined that this only happens
> under a certain set of circumstances. First, the default start time
> and end time must not be set. By that I mean that they must be left
> at 12:00am for both start and end time in the project options under
> calendar. Then, a constraint must be set for a task with a date only
> and no time. In my case it was a Finish no earlier than 6/22/07.
> When I read back the constraint date in VBA, it says 6/26/07 1:13:30
> PM. If I specify the time when I specify the constraint, then
> everything works as it should. If I set the default finish time to
> 4:00 PM, then everything works as it should if I then specify the
> constraint date without a time.
>
> It is almost as if the save date:time for the constraint is faulty
> when their is no valid time entered or no valid default time. I could
> be that the time field is larger than 1 day. Could it possibly be 4.5
> days?
>
mwetzel@buffnet.net 06-21-2007, 12:39 AM I think I know what's going on now. The Project schedules that have
this problem were created by a data export from another scheduling
tool. The problem occurs when someone modifies one of these files and
doesn't type in a time along with the date (thereby using the default
times in the calendar options). For these files, if I look at the
default start and stop times in the calendar options, they both say
midnight. When I type in a date constraint without a time, the date I
read back in VBA is about 4.5 days later. In other words, if I type
in 5/29/07, I'll read back 6/2/07 1:13:30 PM. Now, if I type in
midnight in the calendar options (12:00 AM) for both start and stop
times, subsequent dates entered without times come out fine.
Anyway, the mystery is somewhat understood. The problem is not
solved, but I think a workaround would be to set the defaults in any
of these files BEFORE anyone might enter in a date without a time.
Thanks for your help,
Mark
Jan De Messemaeker 06-21-2007, 07:26 AM Hi Mark,
Import or not, you should ALWAYS set defaults before entering any task in a
project file.
That is the first thing to do by all means!
Greetings,
--
Jan De Messemaeker
Microsoft Project MVP
http://users.online.be/prom-ade
<mwetzel@buffnet.net> wrote in message
news:1182382797.342891.146430@n60g2000hse.googlegroups.com...
>I think I know what's going on now. The Project schedules that have
> this problem were created by a data export from another scheduling
> tool. The problem occurs when someone modifies one of these files and
> doesn't type in a time along with the date (thereby using the default
> times in the calendar options). For these files, if I look at the
> default start and stop times in the calendar options, they both say
> midnight. When I type in a date constraint without a time, the date I
> read back in VBA is about 4.5 days later. In other words, if I type
> in 5/29/07, I'll read back 6/2/07 1:13:30 PM. Now, if I type in
> midnight in the calendar options (12:00 AM) for both start and stop
> times, subsequent dates entered without times come out fine.
>
> Anyway, the mystery is somewhat understood. The problem is not
> solved, but I think a workaround would be to set the defaults in any
> of these files BEFORE anyone might enter in a date without a time.
>
> Thanks for your help,
> Mark
>
|
|
|