Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
other
informationbridge
office.intranets
office.misc
office.setup
office.xml
officeupdate
onenote
photodraw.discussion
powerpoint
producer
proj.standard&server
project
project.developer
project.pro_and_serve
project.server
project.vba
project2000
publisher
publisher.prepress
publisher.programming
publisher.webdesign
visio
visio.createshapes
visio.database.modeling
visio.dev.diagrams
visio.dev.shapesheet
visio.dev.vba
visio.dev.vc
visio.developer
visio.general
visio.installation
visio.printing
visio.software.modeling
visio.troubleshoot
  
 
date: Tue, 16 May 2006 16:33:51 -0700,    group: microsoft.public.project.pro_and_server        back       


VBA runtime error 1100   
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
date: Tue, 16 May 2006 16:33:51 -0700   author:   Tuva

Re: VBA runtime error 1100   
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



Tuva wrote:
> 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
date: Wed, 17 May 2006 11:36:58 +0100   author:   Mike Glen glenATmvps.org

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us