Data models releationship to views (accessing a renamed cell)

P

Paul S

Appologies if this has already been explained, but I found no obvious thread.

I was wondering if you had any ideas on a problem I would like to solve.
Basically from Excel, I am extracting .mpp resource usage data for various
projects. Some people like to keep a number of smaller projects within a
single .mpp work plan. As such, I require them to add a “PID†(Project ID)
Text column to their resource usage view that I filter on. To be flexible
Ideally, since some people use various Text columns for their own use, I
wanted let them choose which Text Column to rename “PID†(perhaps even a
number column).

So the following code for fixed Text1 works fine:

If g_pidFilterMode Then
For Each a In r.Assignments
j = Application.WorksheetFunction.Text(projId,
"0000")
If (j = a.Text1) Then
workDone = a.Work - a.RemainingWork
Set TSV = a.TimeScaleData(StartDate,
EndDate, TimescaleUnit:=pjTimescaleMonths)
printTaskInfo a, row
printPreWork workDone, row
printUsage TSV, row
row = row + 1
End If
Next a

However I’d obviously like to replace a.Text1 with something to the effect
of a.PID.

While I am able to do the following and select a “PID†cell:
On Error GoTo ErrNoMPPPID
j1 = Proj.SelectResourceCell(row:=pRow,
Column:="PID", RowRelative:=False)
On Error GoTo 0

I cannot correlate MS-Projects data-model with the active resource usage
cell.

After extensive viewing of objects in the IDE debugger and looking object
view the object browser/help, I am coming to the conclusion that unlike Excel
that has one view, the internal data model of MS-Project does not map to any
specific view – e.g. resource and task views. Further, I suspect when a
screen is painted (such as resource usage that has “cellsâ€, there is no
exposed (and perhaps no internally retained) portion of the data-model which
relates an active cell to where a specific data is placed)).

I would appreciate any of your thoughts on this issue.
 

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