Anybody know why?

J

John

People,
In a private sub I am looping through the active project resources (see
following code snippet:

Private Sub SetBaseValues()
Dim tblltr as String
tblltr = "A"
For Each R In ActiveProject.Resources
If Not R Is Nothing Then
Set PR = R.CostRateTables(tblltr).PayRates
[rest of loop]
Next R

I get a runtime error 1004, "an unexpected error occurred with this
method" when the code tries to execute the "Set PR = ..." line. If I
change the tblltr variable to an interger, or if I insert "A" or 1 in
place of tblltr in the Set statement, the code runs fine.

According to VBA help, the index for the CostRateTables collection can
be either an index number or cost rate table name. Does anyone know why
I get the error?

John
 
J

JackD

It would seem that the VBA has a bug here and that you should use an
integer.
Why is there a bug?

So much of Project is unknowable that it is capable of spawning its own
religion.
 
J

John

JackD said:
It would seem that the VBA has a bug here and that you should use an
integer.
Why is there a bug?

So much of Project is unknowable that it is capable of spawning its own
religion.


Jack,
I hate when that happens! Actually I suspected it was a bug and already
worked around it by using the integer value, but at least you confirmed
my suspicions.

Thanks
John
 
J

JackD

JackD said:
Jack,
I hate when that happens! Actually I suspected it was a bug and already
worked around it by using the integer value, but at least you confirmed
my suspicions.

Thanks
John

If you are willing to tithe I'll enlighten you as to further mysteries.

-Jack
 
J

John

Jack,
I hate when that happens! Actually I suspected it was a bug and already
worked around it by using the integer value, but at least you confirmed
my suspicions.

Thanks
John

If you are willing to tithe I'll enlighten you as to further mysteries.

-Jack[/QUOTE]

Jack,
You sound just like our church's finance committee. Our church is
currently going through the annual pledge drive.

Unfortunately I find it all too easy to uncover mysteries in Project.
Generally they generate a few hours of frustrating trail and error
effort but eventually I figure out a work-around. I've been doing that
for years.

John
 
B

Brian K - Project MVP

John said:
If you are willing to tithe I'll enlighten you as to further mysteries.

-Jack

Jack,
You sound just like our church's finance committee. Our church is
currently going through the annual pledge drive.

Unfortunately I find it all too easy to uncover mysteries in Project.
Generally they generate a few hours of frustrating trail and error
effort but eventually I figure out a work-around. I've been doing that
for years.

John[/QUOTE]

If you learn well then jack will let you touch the bagwans shoe!
 
J

JackD

John said:
Brian,
I "don't know jack" - but I do know Jack.

Man has this thread degenerated.

John

Oh, it could be a LOT worse. Just ask David Gage.

-Jack
 
J

JackD

See John, even Gary is capable of bringing it down another notch without
even breaking a sweat.
 
G

Gary L. Chefetz [MVP]

Moi? Hey, I wasn't among the MIA.




JackD said:
See John, even Gary is capable of bringing it down another notch without
even breaking a sweat.
 
J

John

Gary L. Chefetz said:
Moi? Hey, I wasn't among the MIA.

guys,
I'm shouting down the hole, are you guys still in there?

Obviously we don't have enough to do.

John
 

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