PRJ4: HoursPerDay/HoursPerWeek Properties Return Wrong Values

Last reviewed: November 24, 1997
Article ID: Q138691
The information in this article applies to:
  • Microsoft Project for Windows, version 4.0
  • Microsoft Project for the Macintosh, version 4.0

SYMPTOMS

The Microsoft Project Visual Basic for applications HoursPerDay and HoursPerWeek properties return only integer values. These values should return real numbers. For example, if you have hours per day set to 6.5, the HoursPerDay property incorrectly returns 6.

WORKAROUND

To work around this problem, return the value of a 1 day or 1 week duration task using Visual Basic code similar to the following:

Microsoft provides examples of Visual Basic for applications 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.

   'Save contents of Project DurationX field. You can use any of the three
   'duration fields such as Duration1, Duration2, and Duration3.
   Temp = ActiveProject.Duration1

   'Enter a 1d or 1w duration into a task to calculate the true HoursPerDay
   'or HoursPerWeek. For example:
   ActiveProject.Duration1 = "1d"

   'Return the correct hours per day or week to your function.
   MsgBox ActiveProject.Duration1 /60

   'Set the contents of the Duration field back to its original value.
   ActiveProject.Duration1 = Temp

STATUS

Microsoft has confirmed this to be a problem in the products listed at the beginning of this article. We are researching this problem and will post more information here in the Microsoft Knowledge Base as it becomes available.

REFERENCES

For additional information, please see the following article(s) in the Microsoft Knowledge Base:

   ARTICLE-ID: Q132092
   TITLE     : PRJ4: Converting Duration Values


Additional query words: 4.10
Keywords : kbcode kbprg
Version : 4.0
Platform : MACINTOSH WINDOWS
Issue type : kbprb


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: November 24, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.