How to report timescale data by Assignment? Rod, are you out there?

A

andy.novak

The very excellent book "VBA Programming for Microsoft Office Project"
includes a section that talks about reading timephased data. The two
examples are about reading that data by task and by resource.

How does one of these examples need to be changed to read timescaled
data for a specific assignment (cross section of task and resource)?
Which parameters need to be changed and to what? I am at a complete
loss.

Thanks,
Andy Novak
UNT
 
A

andy.novak

The very excellent book "VBA Programming for Microsoft Office Project"
includes a section that talks about reading timephased data.  The two
examples are about reading that data by task and by resource.

How does one of these examples need to be changed to read timescaled
data for a specific assignment (cross section of task and resource)?
Which parameters need to be changed and to what?  I am at a complete
loss.

Thanks,
Andy Novak
UNT

Here's what I've got and I get an argument is invalid error:

Set tsvs =
ActiveProject.Tasks(1).Assignments(1).TimeScaleData(StartDate:=ActiveProject.ProjectStart,
EndDate:=ActiveProject.ProjectFinish,
Type:=pjAssignmentTimescaledActualWork,
TimeScaleUnit:=pjTimescaleDays, Count:=1)
For Each tsv In tsvs
Debug.Print "Start: " & Format(tsv.StartDate, "Long Date"),
"Actual Work: " & Val(tsv.Value) / 60 & "h"
Next tsv

Also....How do I ensure that the Assignment number, e.g., (1), is
actually for the resource I want to deal with for that particular
task?
 
J

Jack Dahlgren MVP

It is pretty much the same as task or resource except that you reference the
assignment instead.

So if you wanted to do this for a resource

expression.TimeScaleData(StartDate, EndDate, Type, TimeScaleUnit, Count)

Sub tsAss()
Dim myAss As Assignment
Dim Asgts As Assignments
Dim TSV As TimeScaleValues
For Each Resource In ActiveProject.Resources
Set Asgts = Resource.Assignments
For Each myAss In Asgts
Set TSV = myAss.TimeScaleData("1/1/2010", "12/31/2010",
pjAssignmentTimescaledWork, pjTimescaleDays, 1)
'do stuff with TSV
Next myAss
Next Resource
End Sub

-Jack Dahlgren
 
A

andy.novak

It is pretty much the same as task or resource except that you reference the
assignment instead.

So if you wanted to do this for a resource

expression.TimeScaleData(StartDate, EndDate, Type, TimeScaleUnit, Count)

Sub tsAss()
Dim myAss As Assignment
Dim Asgts As Assignments
Dim TSV As TimeScaleValues
For Each Resource In ActiveProject.Resources
Set Asgts = Resource.Assignments
For Each myAss In Asgts
Set TSV = myAss.TimeScaleData("1/1/2010", "12/31/2010",
pjAssignmentTimescaledWork, pjTimescaleDays, 1)
'do stuff with TSV
Next myAss
Next Resource
End Sub

-Jack Dahlgren








- Show quoted text -

OK. Here's what I'm really wanting to do and perhaps someone could
provide a tip as to the easiest day to do it.
There is a project with 10 tasks (strictly for timekeeping with 0
hours).
All the resources have submitted time against the various tasks in the
project. Now the manager wants to go with just the first task for time
reporting.
I want to pull by day the total hours entered for each resource,
overlay the daily "buckets" in TASK ONE with the total hours for the
resource, remove tasks 2-10, then republish. Actual hours per day is
still the same for each resource but all in one task instead of spread
across several.
Hope this makes sense.

Thanks
Andy
 
J

Jack Dahlgren MVP

An interesting problem.
I think I'd look at the timescaled values on a resource level (this gets all
resource assignments for the resource)
Then delete all of that resources assignments.
Then reconstruct the resource assignments for Task 1 based on the timescaled
values you have saved.
Probably will want to build an array or something to hold them. I'd imagine
you want just the actuals too...
Could get tricky if you have future assignments on the other tasks and are
just keeping actuals in the first task.

Definitely test this out before you use it.
 
R

Rod Gill

This reads like my Project Control Center macro. Page 253 onwards covers
copying Resource assignment totals from one project to one task in another.
Should provide enough code (with some editing) to get you going.

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




OK. Here's what I'm really wanting to do and perhaps someone could
provide a tip as to the easiest day to do it.
There is a project with 10 tasks (strictly for timekeeping with 0
hours).
All the resources have submitted time against the various tasks in the
project. Now the manager wants to go with just the first task for time
reporting.
I want to pull by day the total hours entered for each resource,
overlay the daily "buckets" in TASK ONE with the total hours for the
resource, remove tasks 2-10, then republish. Actual hours per day is
still the same for each resource but all in one task instead of spread
across several.
Hope this makes sense.

Thanks
Andy

__________ Information from ESET Smart Security, version of virus
signature database 4913 (20100303) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4913 (20100303) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
A

andy.novak

This reads like my Project Control Center macro. Page 253 onwards covers
copying Resource assignment totals from one project to one task in another.
Should provide enough code (with some editing) to get you going.

--

Rod Gill
Microsoft MVP for Project -http://www.project-systems.co.nz

Author of the only book on Project VBA, see:http://www.projectvbabook.com











__________ Information from ESET Smart Security, version of virus signature database 4913 (20100303) __________

The message was checked by ESET Smart Security.

http://www.eset.com- Hide quoted text -

- Show quoted text -

Thanks Rod. I hadn't gone that far yet in the book. Just going over
the techniques to read and write timescale data.
 
R

Rod Gill

What?! This should be compulsory bed time reading!!

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




Thanks Rod. I hadn't gone that far yet in the book. Just going over
the techniques to read and write timescale data.

__________ Information from ESET Smart Security, version of virus
signature database 4913 (20100303) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4913 (20100303) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 

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