The argument value is not valid

R

rafalag

Hi,

I have the following code:

Sub Populate_QC3()
Dim mytask As Task
For Each mytask In ActiveProject.Tasks
If Not (mytask Is Nothing) Then
mytask.EnterpriseProjectNumber1 = mytask.EnterpriseNumber5
End If
Next mytask
End Sub

When I run the macro I receive the following error:
Run-time error '1101':
The argument value is not valid

Can you help me how to correct the code?

Thanks,

Rafal
 
J

John

rafalag said:
Sub Populate_QC3()
Dim mytask As Task
For Each mytask In ActiveProject.Tasks
If Not (mytask Is Nothing) Then
mytask.EnterpriseProjectNumber1 = mytask.EnterpriseNumber5
End If
Next mytask
End Sub

rafalag,
This question was asked previously in a post to this newsgroup on
11/4/05 by TroyS, titled "assign values to a EnterpriseProjectNumber".
Check out Rod Gill's response in the thread.

The bottom line is that the VBA object browser lies -
EnterpriseProjectNumbers do NOT belong to tasks, they belong to the
project.

Hope this helps.
John
Project MVP
 
R

rafalag

John,

Thank you for the help! Now I have it working!
I had wrong langueage settings in google search when I was looking for
help before my question in this forum :)

Thanks,

Rafal
 
J

John

rafalag said:
John,

Thank you for the help! Now I have it working!
I had wrong langueage settings in google search when I was looking for
help before my question in this forum :)

Thanks,

Rafal

Rafal,
You're welcome.
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