Run time error entering BeforeTaskChange (MSP 2007 VA)

C

Craig L M

We are having a problem running VBA code in 2007: The BeforeTaskChange Event
is throwing the a run time error upon entry. The BeforeTaskChangeEvent is
triggered but VBA code executon doesn't enter the Sub, instead we get:
Run Time Error 458: Variable uses an Automation Type not supported in Visual
Basic.

It worked fine in MSP 2003 VBA. It doesn't happen every time through the
event either. It seems to happen after the before save event fires, and I
have noticed only on the field 188744826 (which docs show as the Commitment
Guid (Task) field). I am not familiar with that field and I can't find it
referenced anywhere else. Could this field be causing the problem? Is this
the same field as the Deliverable Guid? If so, why two names?

Can someone that has more knowlege of MSP 2007 take a look at this? Is it a
bug in Project 2007? Our code hasn't changed from 2003 and exactly mirrors
the example found in the Project 2007 help, so I am assuming it should work.
Is there a library reference we need to add to the VBA project or something?
Here is the line of code that is failing with the 458 error:

Private Sub pApp_ProjectBeforeTaskChange(ByVal Tsk As Task, ByVal Field As
PjField, ByVal NewVal As Variant, Cancel As Boolean)

and here is the example from the 2007 help:
Private Sub App_ProjectBeforeTaskChange(ByVal tsk As Task, ByVal Field As
PjField, ByVal NewVal As Variant, Cancel As Boolean)

If no one can help, can you at least point us to a resource where we can get
some help? This is a critical problem that is delaying our Project 2007
solution and costing us a lot of dollars. I would settle for a work-around
at ths point. I am pretty much begging here...

Thanks,
Craig
 
C

Craig L M

Thanks for responding. The code compiles successfully.
Like I said, it also doesn't error every time through the Sub; it just seems
to be doing it on the Commitment Guid field.

I saw another post a while back with 2 posters the same problem. It was not
resolved. If you search for "458" you will see the post. Their posts don;t
mention the Commitment Guid field, but maybe they didn't check. I was hoping
we could work on this and get a resolution for everyone this time, since it
doesn't seem to be an isolated incident.
Thanks,
Craig
 

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