S
scott_hanebutt
I have written vb code to color code some tasks. When I step through the
code it seems to execute correctly, however the color does not change.
To elaborate:
I do not recieve any unexpected errors.
The line that sets the color is executed (verified by stepping through the
code) but the color does not change.
I coppied the same code outside of the Select case and it does change color.
Sub S2_2005()
' Filters tasks so only ones with a date in "Finish1" appear
FilterEdit Name:="S2_2005", taskfilter:=True, create:=True,
overwriteexisting:=True, FieldName:="Finish1", _
Test:="does not equal", Value:="NA", ShowInMenu:=False,
showsummarytasks:=True
FilterApply Name:="S2_2005"
On Error GoTo ErrHandler
For Each Task In ActiveProject.Tasks
Select Case Task.Number19
Case Is > 0
SelectRow Row:=Task.ID, rowrelative:=False
Font Color:=pjGreen
Case Is < 0
SelectRow Row:=Task.ID, rowrelative:=False
Font Color:=pjRed
Case Else
End Select
'SelectRow Row:=Task.ID, rowrelative:=False
'Font Color:=pjRed
Next Task
ErrHandler:
Resume Next
End Sub
Any thoughts would be apreciated.
Scott Hanebutt
code it seems to execute correctly, however the color does not change.
To elaborate:
I do not recieve any unexpected errors.
The line that sets the color is executed (verified by stepping through the
code) but the color does not change.
I coppied the same code outside of the Select case and it does change color.
Sub S2_2005()
' Filters tasks so only ones with a date in "Finish1" appear
FilterEdit Name:="S2_2005", taskfilter:=True, create:=True,
overwriteexisting:=True, FieldName:="Finish1", _
Test:="does not equal", Value:="NA", ShowInMenu:=False,
showsummarytasks:=True
FilterApply Name:="S2_2005"
On Error GoTo ErrHandler
For Each Task In ActiveProject.Tasks
Select Case Task.Number19
Case Is > 0
SelectRow Row:=Task.ID, rowrelative:=False
Font Color:=pjGreen
Case Is < 0
SelectRow Row:=Task.ID, rowrelative:=False
Font Color:=pjRed
Case Else
End Select
'SelectRow Row:=Task.ID, rowrelative:=False
'Font Color:=pjRed
Next Task
ErrHandler:
Resume Next
End Sub
Any thoughts would be apreciated.
Scott Hanebutt