-1

Has anyone been able to get the time-phased work effort VBA extract macro by Jack Dalhgren, its quite an old macro.

I've been able to create the form and the macro works for the default timephase which is weeks, but if I select another say months I get an error on this line of code. (runtime error 13, type mismatch)

Set pTSV = ActiveProject.ProjectSummaryTask.TimeScaleData(tbstart.Value, tbend.Value, , cboxTSUnits.Value)

http://zo-d.com/blog/archives/programming/analyze-microsoft-project-resource-usage-data-in-excel.html

Thank you

braX
  • 11,506
  • 5
  • 20
  • 33
Alw
  • 1

1 Answers1

1

The comboBox in the code uses 2 columns, the text and the internal representation which is a number. The code uses predefined constants for it like pjTimescaleWeeks. The call to TimeScaleData expects this number as parameter.

It is likely that you get the text (a String) as result from the comboBox, (eg "Week"), and this causes the Type mismatch.

You can specify that you want the value of the 2nd column as Value from the combobox. You can do this using the VBE form designer, set property BoundColumn to 2, or you can do this in you code:

Sub fillTSUnitsBox()
    ...
   cboxTSUnits.List = myArray
   cboxTSUnits.BoundColumn = 1
   cboxTSUnits.Value = 3
End Sub
FunThomas
  • 23,043
  • 3
  • 18
  • 34