Search code examples
vbams-project

Set Duration Units to hours in VBA when generating a new MS Project


The default Duration Unit for MS Project is Days, but most of our Projects require the duration units to be displayed in hours. I use VBA to generate new Projects; does anyone know how to set MS Project Duration Units to hours in VBA?


Solution

  • The Project object has a property called DefaultDurationUnits; set it to pjHour.

    For example:

    ActiveProject.DefaultDurationUnits = pjHour