Parameters in events

M

Montse

Hello,

I’m working with the event ProjectBeforeResourceChange2 in MS Project
Professional 2002.

The procedure which implements it, has the next parameters:

Private Sub object_ProjectBeforeResourceChange2(ByVal res As
MSProject.Resource, ByVal Field As PjField, ByVal NewVal As Variant, Info As
MSProject.EventInfo)

But I can compile my code only when I write:

Private Sub object_ProjectBeforeResourceChange2(ByVal res As
MSProject.Resource, ByVal Field As PjField, ByVal NewVal As Variant, ByVal
Info As MSProject.EventInfo)

The parameter Info only admits ByVal and not ByRef or nothing. As a
result, the variable's value can't be changed by the procedure to which it is
passed so I can’ stop the event although I assign the value true to
Info.Cancel.

What can I do to avoid that event happens?

Thank you in advance.
 
M

Mark Durrenberger

Perhaps I misunderstand your question but do you want to disable your code
within the projecbeforechange...

If so, you can set the class containing the event code to "nothing"

Mark

--
_________________________________________________________
Mark Durrenberger, PMP
Principal, Oak Associates, Inc, www.oakinc.com
"Advancing the Theory and Practice of Project Management"
________________________________________________________

The nicest thing about NOT planning is that failure
comes as a complete surprise and is not preceded by
a period of worry and depression.

- Sir John Harvey-Jones
 

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