Simple routine stops working in MSP2007

J

JimS

I wrote a simple routine for my client that simply copied Text10 (task) to
Text10 (assignment) so that when they viewed the Resource Usage layout, they
could see the task's Text10. Here's the routine:

Sub TransferTaskText1ToAssignmentText1()
Dim t As Task
Dim a As Assignment
Dim r As Resource
On Error Resume Next

For Each t In ActiveProject.Tasks
For Each a In t.Assignments
a.Text10 = t.Text10
Next a
Next t
End Sub
--------------------------------------------
I do the Resume Next because they wouldn't know what to do if they saw an
error box. Anyway, the routine worked perfectly in MSP2003, but after
clearing the new security settings in MSP2007, it runs, but does not appear
to have copied.

I debugged it, and found that "a.Text10" is indeed showing as identical to
"t.Text10" after the assignment statement. Yet the column in the Resource
Usage view called "Text10" is not changed.

This has to be something simple. Ideas?
 
J

JimS

Thank you, Jan. It worked like a charm.
--
Jim


Jan De Messemaeker said:
Hi,

You will find the whole explanation on this oddity in

http://www.mvps.org/project/faqs.htm
Faq 37: Custom fields in tables.
The code you show probably comes from that faq but there is a newer version
including the Project 2007 oddity and how to work around.

Greetings,
--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf



.
 

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