Alternate Means of getting Task Data?

J

jsl

Hope someone can help me out with this...

I am building a spreadsheet from inside Project 2003 Pro (not Server)
that basically has for each Task in the Project (or task in the set of
filtered records) one or more rows in the spreadsheet, depending on how
many predecessors and successors the task has.

e.g. if the task has 1 predecessor and 0 or 1 successors (or vice
versa), there is 1 row in the spreadsheet. If the task has 5
predecessors and 3 successors, then there are 5 rows in the spreadsheet
with the basic task data, 2 of which have empty successor data and all
5 of which have the predecessor data (or vice versa if there's more
successors than predecessors).

The easiest approach I found was to go through and build the basic data
part of the spreadsheet first, duplicating the rows of basic task data
based on ActiveSelection.Tasks(myindex) and
ActiveSelection.Tasks(myindex).PredecessorTasks.Count and
SuccessorTasks.Count. It checks and skips summary tasks.

Then make a 2nd pass through the spreadsheet/project, adding in the
Predecessor data, and finally a 3rd pass through the
spreadsheet/project for the Successor data.

For the 2nd and 3rd passes, I'm having to index through the project
file using TaskName instead of task index number. This basically works
fine EXCEPT in the case where there's multiple tasks with the same task
name. In that case, naturally it finds the first instance of a task
with that name.

My question is this...Other than adding a loop do something like "if
the Task UID of the "found task" is not equal to the UID of the task in
the spreadsheet, skip me and look further", is there an easier way to
index from my spreadsheet back to the original (filtered) project file?

I'm sure there's probably a way to do what I want in Access (don't have
SQL server etc), but I'm not that Access smart. Because the next step
in this process is to take the Excel spreadsheet and import it or link
it to an Access table and do a custom report, since we can't get the
Reports/Custom built-in capability to give us the report showing the
data we want.

(If I could get at any underlying SQL or XML that goes with the
Reports/Custom/MYreport report, I could solve this whole issue much
quicker and with much less frustration and gnashing of teeth.

thanks in advance...

--jsl
 
J

Jan De Messemaeker

Hi,

Normally this is solved by writing the ID or the UID in another column in
Excel.
HTH
 
J

jsl

I've got that. I tried referencing using ID and it didn't work, so I
reckon I need to do something with using both. Just not sure how.
 
J

JackD

I am having a hard time understanding why you are making so many passes.
You should be able to make a single pass

Pseudo code would look something like this.

set a tasks collection to the relevant tasks from project (activeproject or
activeselection)
loop through all the tasks
for each task (if not blank or summary)
write the task,
count the predecessors
count the successors
while it has not reached the count
write pred
move to the right
write successor
move down a row and back one column
end while
move down and left
next task
 
J

jsl

I'm probably not using the most effective approach but it works now.

I was originally doing a single pass but was having problems, as I
recall, relating to cases where there were many more predecessors than
successors or vice versa.

I ended up solved the problem using Application.Find (Task UID) to get
the appropriate Task Name to go with that UID.

I should just write myself draft e-mails/messages describing what's
going on, because so much of the time, soon after I document the
behavior in an e-mail or message, my brain becomes de-fogged and I work
out some sort of solution.
 
J

JackD

I should just write myself draft e-mails/messages describing what's
going on, because so much of the time, soon after I document the
behavior in an e-mail or message, my brain becomes de-fogged and I work
out some sort of solution.

This is very common. Happens with me too.

-Jack
 

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