Timescale date question

B

Bob Inwater

All of the timescale data examples I have seen & things I have tried,
generate a report that sums the total value for a resource (peak units,
usage or whatever). On the other hand the Timescale wizard in the analyze
tool bar produces resource units per task (not the total value of that
resource across all the tasks).

Any bright ideas on how to access a resource per task / per time period?

Bob
 
J

Jan De Messemaeker

Hi Bob,

"Resource per task" is called assignment
The assignments' timescaled data are available methods.
HTH
 
B

Bob Inwater

I was afraid of that. My attempts to use of "assignment" is makeing me feel
pretty dumb. Could you point me to some code samples that access Assignment.

Bob
(VBA rookie)
 
J

Jan De Messemaeker

Hi Bob,

How about:

Sub copytext1
dim AnAss as assignmentr
dim Atsk as task
for each atsk in activeproject.tasks
if not atsk is nothing then
for each anAss in atsk.assignments
anass.text1=atsk.text1
next anass
endif
nex atsk
end sub

Assignments have timescaledata just like tasks or resources.
See the help (for instance through the object browser) for syntax.
HTH
 
B

Bob Inwater

Ok I see that your code works but I still can not figure out how to access
assignment timescaledata.. I am good with Task and Recourse TSV but can not
seem to hack my way in to assignment.
Set TSV = ActiveCell.Task.TimeScaleData(StartDate, EndDate,
pjTaskTimescaledRegularWork, TimescaleUnit:=pjTimescaleDays)
Works great and I more of less understand how this works.

Any number of net, MSDN, and help file searches have left me without and
answer.

Could it be the fact that 2003 is goofy for accessing assignment? I
downloaded some code from ProjectLearning.com that looks contain code for
what I want but that code produces an empty doc. Seems like their code is
relatively sophisticated and I get the same kind of errors.
 
B

Bob Inwater

This link is to an artical in the MSDN and this code really does not work!

http://msdn.microsoft.com/library/d...pjsdk/html/pjobjtimescalevalue_HV45317741.asp

Dim TSV As TimeScaleValues, HowMany As Long
Dim HoursPerDay As String

Set TSV = ActiveCell.Resource.TimeScaleData("10/7/02", "10/11/02",
TimescaleUnit:=pjTimescaleDays)

For HowMany = 1 To TSV.Count
HoursPerDay = HoursPerDay & TSV(HowMany).StartDate & " - " & _
TSV(HowMany).EndDate & ", " & TSV(HowMany) / 60 & vbCrLf
Next HowMany

MsgBox HoursPerDay
 
J

Jan De Messemaeker

This has nothing to do with assignment, it must be a different problem.
There are a few reasons why IMHO this code cannot work, too long to explain,
let's be positive.
 
J

Jan De Messemaeker

Hi Bob,

Except for font changes I never use things like activecell to access
objects.
I access assignments either through the task object
atask.assignments(x)
or through a for each loop (see my example).
assignment.timescaledata has identical rules through Task and resoouce, I
fail to see a problem there.
HTH
 

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