Schedule Successors and finding a path from one activity to another if it exists

Started by matthew, September 29, 2020, 04:18:05 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

matthew

Hi,
I guess my query isn't specific to visio vba though the outcome of it would be used by my visio vba code (to link objects together) so hopefully this post is ok in this section.
My code needs to link various objects together which I think I know how to do.  However, if you think of the objects as milestones where the milestone is the start or finish of an activity (in a schedule) the objects that need to be linked to it are the successors, if that successor is part of a list of task IDs I have defined (and so would be an object on the chart), which belong to a schedule that may contain many more activities, typically thousands.
The tricky part here is that in a normal schedule each activity might have several, sometimes many,  successors.  If I want to know if one of my activities is linked to any of the others via any task in a schedule then I would need to follow the chain through every successor's successor until I find it or until the chain ends (no successors).  This means there would be multiple branches and any number of task IDs in the chain.
This would be a very clever bit of code which I don't mind saying is beyond my capabilities.  Has anyone here had the same problem / is there anyone out there that knows how to do this?  If so I'd love to hear from you.  My code is for my own benefit at work but I'm not expecting something for nothing.
For info,  my visio vba code opens an excel file that contains an extract from the Planning Tool i.e. all the activities, their IDs and their successors.  Another worksheet identifies the activities I use for milestones.  I don't know whether it would be easier/better to have an excel macro that did this (using excel functions) and then populated the relevant worksheet which the visio vba could read or have the visio vba do it all.
Please get in touch if you can help me.
Kind regards
Matthew

matthew

ok, did a a bit of research and found a method that is used to calculate the shortest distance between 2 points, won't work for me here but has given me an idea about how this can be done .  My programming skills may not be up to it but I'll give it a go, thank you

wapperdude

Visio 2019 Pro

matthew

Hi,  my code is to create a different type of chart that the planning tools don't do (which is a format that I and many others I know use), thanks, Matthew