Project: AdjustDates Macro Incorrectly Reschedules Tasks

Q126103


The information in this article applies to:


SYMPTOMS

When you use the Microsoft Project AdjustDates macro, some tasks are not properly rescheduled to the correct dates.

-or-
When you use a Visual Basic, Applications Edition, DateDifference, DateAdd, or DateSubtract method, incorrect values or dates are calculated.


CAUSE

The DateDifference, DateAdd, and DateSubtract methods, by default, always base calculations on the project's standard calendar instead of on the project calendar.

Note that the Help topics for these methods say that their calculations should be based on the project's calendar unless otherwise specified.


WORKAROUND

To force the DateDifference, DateAdd, and DateSubtract methods to base calculations on the project calendar instead of the project standard calendar, always specify the optional calendar parameter.

For example, use the following:


   DateDifference(startDate:= #1/1/94#, finishDate:= #1/31/94#, _
                  Calendar:= ActiveProject.Calendar) 
Instead of:

   DateDifference(startDate:= #1/1/94#, finishDate:= #1/31/94#) 
NOTE: To correct the AdjustDates macro, search for all instances of DateAdd, DateSubtract, and DateDifference, and supply the optional third (calendar) parameter as "ActiveProject.Calendar."

Microsoft provides examples of Visual Basic procedures for illustration only, without warranty either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This Visual Basic procedure is provided 'as is' and Microsoft does not guarantee that it can be used in all situations. Microsoft does not support modifications of this procedure to suit customer requirements for a particular purpose.

Additional query words:

Keywords :
Issue type : kbbug
Technology : kbHWMAC kbOSMAC kbProjectSearch kbProject400Mac kbProjectMacSearch kbProject400


Last Reviewed: November 5, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.