PRJ: TimeScaledData Method Example Run Time Error 91Last reviewed: November 24, 1997Article ID: Q113397 |
The information in this article applies to:
SYMPTOMSThe sample code for the TimeScaledData method in Visual Basic for Applications Help may produce a "Run Time Error 91" error message when you use it with projects that contain blank rows. Under normal circumstances, this macro should run correctly and create a .CSV file.
CAUSEThe sample code for this macro does not take blank rows into account; therefore, the Run Time error is produced when the macro encounters a blank task row.
RESOLUTIONTo work around this problem, add additional commands to the macro code that will trap the error situation. To trap the error, add "If Not (t is Nothing) then . . . end if" around the For Next loop in the macro. When you add this code, the error will be trapped and the example will run on files with blank task rows. The resulting code example looks like this:
Sub AssignmentsOverTime() Dim t, r, temp Open "USAGE.CSV" For Output As #1 For Each t In ActiveProject.Tasks If Not (t is Nothing) Then 'NEW LINE Print #1, t.Name For Each r In t.Resources temp = TimescaledData(t.ID, r.ID, ActiveProject.ProjectStart, _ ActiveProject.ProjectFinish, pjWork, pjTimescaleWeeks) Print #1, r.name & ListSeparator & temp Next r End If 'NEW LINE Next t Close #1 End Sub MORE INFORMATION
Steps to Reproduce Behavior
|
Additional query words: 4.00
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |