General discussion

Locked

task outline codes in OLAP error

By jdb ·
I recently purchased a copy of the MS Project Resource Guide. Starting on page 92 there is an example of how to add a task outline code to the portfolio analyzer OLAP cube. I've just tried implementing this (using the sample code) but now have the following error message everytime I try to exit a project: "Run-time error '**': Object variable or with block variable not set." When I select "debug" the VB editor highlights the entire routine for the Error Handler.

Any ideas or help appreciated.

This conversation is currently closed to new comments.

3 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Comments

Collapse -

task outline codes in OLAP error

by danielz In reply to task outline codes in OLA ...

Had the same problem. Got this answer:
Problem
---------
The problem with the macro was because the variable "asnA" was pointing
nowhere. I mean there was no "task assignment" associated to that variable.

Solution
--------
Each task has 0 or more assignements to it. Those assignments are in the
task property "Assignments" and that property has a table of Items. Each
item is an assignment.

task
assignments
item(1) 'Assignemnt 1
item(2) 'Assignemnt 2 item(3) 'Assignemnt 3
...

So the Task Enterprise Outline code must be copied on each item
(assignement)

tskT.Assignments.Item(i).EnterpriseResourceOutlineCode5 =
tskT.EnterpriseOutlineCode1

You should replace the main part of the macro with following :


If Application.Projects.Count > 0 Then
If ActiveProject.Tasks.Count > 0 Then
For Each tskT In ActiveProject.Tasks
If Not (tskT Is Nothing) Then
nbItems = tskT.Assignments.Count
If nbItems > 0 Then
For i = 1 To nbItems

tskT.Assignments.Item(i).EnterpriseResourceOutlineCode5 = _
tskT.EnterpriseOutlineCode1 Next i
End If
End If
Next tskT
End If
End If

I hope it will help you.

Hugues Perron

Collapse -

task outline codes in OLAP error

by jdb In reply to task outline codes in OLA ...

Thanks for the help Hugues. Interesting solution. I have also created another solution that appears to work:

Sub upAssns()
Dim t As Task
Dim a As Assignment

If Application.Projects.Count > 0 Then
If ActiveProject.Tasks.Count > 0 Then
For Each t In ActiveProject.Tasks
If Not (t Is Nothing) Then
For Each a In t.Assignments
a.EnterpriseResourceOutlineCode4 = t.EnterpriseOutlineCode3
Next a
End If
Next t
End If
End If

Let me know what you think of that too.

Collapse -

task outline codes in OLAP error

by jdb In reply to task outline codes in OLA ...

This question was closed by the author

Back to IT Employment Forum
3 total posts (Page 1 of 1)  

Related Discussions

Related Forums