Greetings all,
I am currently learning Microsoft Project (working on 2002) as well as VBA so this may be a simple issue, but I get somewhat lost.
Let's imagine we have this scheme showing in the Task Usage page. I am showing here the Task Name and Actual Work columns :
+ Task1...............10 hrs
--- ResourceA.........8 hrs
--- ResourceB.........2 hrs
+ Task2...............5 hrs
--- ResourceB.........5 hrs
I would like to update the Actual Work of a Resource for a given Task, from an external source such as a TXT file.
In this File I would e.g. have :
and my Task Usage should then show this :
+ Task1...............12 hrs
--- ResourceA.........10 hrs
--- ResourceB.........2 hrs
+ Task2...............8 hrs
--- ResourceB.........8 hrs
For this I see I need to load the Actual_Work vlaue from the TXT file, and add it to the value situated in the Actual Work field.
I have tried this simple macro line :
... and whatever cell is the "Active" one, it gives correctly the name of the associated Task.
Then I tried this one :
.. and it won't work unless I go to the Resource Usage page (this seems totally normal to me hehe).
So : HOW in VBA can I identify :
- the Resource Name in the Task Usage page
or
- the Task Name in the Resource Usage page
In other words : How can I identify in VBA this Assignment link ?
I am currently learning Microsoft Project (working on 2002) as well as VBA so this may be a simple issue, but I get somewhat lost.
Let's imagine we have this scheme showing in the Task Usage page. I am showing here the Task Name and Actual Work columns :
+ Task1...............10 hrs
--- ResourceA.........8 hrs
--- ResourceB.........2 hrs
+ Task2...............5 hrs
--- ResourceB.........5 hrs
I would like to update the Actual Work of a Resource for a given Task, from an external source such as a TXT file.
In this File I would e.g. have :
Code:
Task_Name Resource_Name Actual_Work
Task1 ResourceA 2
Task2 ResourceB 3
and my Task Usage should then show this :
+ Task1...............12 hrs
--- ResourceA.........10 hrs
--- ResourceB.........2 hrs
+ Task2...............8 hrs
--- ResourceB.........8 hrs
For this I see I need to load the Actual_Work vlaue from the TXT file, and add it to the value situated in the Actual Work field.
I have tried this simple macro line :
Code:
MsgBox ("value : " & ActiveCell.Task.GetField(FieldID:=pjTaskName))
... and whatever cell is the "Active" one, it gives correctly the name of the associated Task.
Then I tried this one :
Code:
MsgBox ("value : " & ActiveCell.Resource.GetField(FieldID:=pjResourceName))
.. and it won't work unless I go to the Resource Usage page (this seems totally normal to me hehe).
So : HOW in VBA can I identify :
- the Resource Name in the Task Usage page
or
- the Task Name in the Resource Usage page
In other words : How can I identify in VBA this Assignment link ?