VBA runtime error 1100

T

Tuva

I am trying to customize a Project Pro file with some VBA code.
Specifically, I want to change the color of a task based on a user's entry
in a text column. I've attached some code to the ProjectBeforeTaskChange
event. The event fires just right but I do not seem to be able to address
the SelectRow property from the Application project without generating an
error. Here is the code:

----------- MyEvents (Class Module)
Public WithEvents App As Application
Private Sub App_ProjectBeforeTaskChange(ByVal tsk As Task, ByVal Field As
PjField, ByVal NewVal As Variant, Cancel As Boolean)

If Field = pjTaskText1 Then
TaskText = NewVal

If TaskText = "Active" Then
App.SelectRow row:=tsk, RowRelative:=False
Font Color:=1
Else
App.SelectRow row:=tsk, RowRelative:=False
Font Color:=4
End If
End If

End Sub

------------- MyModule (Module)
Dim AppEvents As New MyEvents

Sub BindEventToApplication()
Set AppEvents.App = Application
End Sub


The lines App.SelectRow row:=tsk, RowRelative:False always generate this
error:

Run-time error 1100:
The method is not available in this situation


I have verified that the variable App is indeed accessable in the event. For
example, code such as "i = App.Projects.Count" operates just fine.

I am stumped and must be missing something obvious, help anyone?!

Jib
 
M

Mike Glen

Hi Jib,

Try posting on the developer newsgroup as this one is closing down. Please
see FAQ Item: 24. Project Newsgroups. FAQs, companion products and other
useful Project information can be seen at this web
address:http://project.mvps.org/faqs.htm .

Mike Glen
Project MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top