Master and subproject

N

Newbie

Hello,
Is it possible to check with VBA if the active project is (or is not )
inserted in another projet (a master project), and which one ?

Thanks for help,

Newbie
 
J

Jan De Messemaeker

Hi Newbie,

No, I'm afraid not.
A project can be insterted in as many masters as you like, but it doesn't
record that fact.
When it's connected to a pool, that can be checked.
Hope this helps.
 
N

Newbie

John said:
Jan,
I never like to see "no" for an answer. I say the answer is "yes". Now,
how can it be done (think way outside the box)?

Nothing like stirring up a little controversy for the weekend :)
John

Hello John,

Well, so I'm waiting for your answer on next Monday !
Have a nice weekend ;-)

Newbie
 
J

John

Jan De Messemaeker said:
Hi Newbie,

No, I'm afraid not.
A project can be insterted in as many masters as you like, but it doesn't
record that fact.
When it's connected to a pool, that can be checked.
Hope this helps.

--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
http://users.online.be/prom-ade/
+32-495-300 620

Jan,
I never like to see "no" for an answer. I say the answer is "yes". Now,
how can it be done (think way outside the box)?

Nothing like stirring up a little controversy for the weekend :)
John
 
Z

Zac Maclean

end>

Newbie said:
Hello John,

Well, so I'm waiting for your answer on next Monday !
Have a nice weekend ;-)

Newbie
Two thoughts:

1. If you can tell that a Project is a "Master", you can read the list
Subprojects from them. Do what you need to the objects in this list.

2. If you have mulitple layers (Master > Sub1 > Sub 2) then if a project
is not Master, it must be a sub, and can be parsed however you need to.

I am doing something similar, I have the following:
Master:
Sub1 -->Sub1a
-->Sub1b
Sub2
-->Sub2a
-->Sub2b

Etc... But no deeper. I need to recalcuate only the Sub(X)(y) level.. So..
I look to see if it is a "master" if not, I re-calculate it.
 
J

JackD

Actually, you may be able to find SOME of the masters it is inserted in, but
I believe that it is nearly impossible to guarantee that you have found all
masters it is inserted in. If the file is on a networked drive, the solution
involves searching and opening all .mpp files on every computer which is
connected to the network. Because of the possibility that some of these may
be turned off and won't be searchable, it is impossible to state that this
is always possible. If you are willing to go far enough and wait long
enough, then the answer is yes, but not in any reasonable timeframe.
 
J

John

Hello John,

Well, so I'm waiting for your answer on next Monday !
Have a nice weekend ;-)

Newbie

Newbie,
Jack and Zac outlined the essence of the approach that popped into mind
when I read your post. I guess they think outside the box also. Jack
made an important point. The method works best if the master file(s) are
are on the same PC, which may not be that far-fetched.

By the way, why do you want to know if a file is a subproject of a
master? You have described a specific outcome. If we understood what
your end goal is, there may be a better solution we can suggest.

John
 
J

Jan De Messemaeker

Hi,

All you write is perfectly true and nicely way out of the box.
Still, the answer to the poster's question remains sorry, no, you cannot
tell whether a project has been inserted in a master anywhere.
You can of course reply yes to other questions that have not been asked, but
I'm very sorry, I try to stick to the question asked. Probably a limitation
in my mind.

Greetings,
 
N

Newbie

Hi every body,
Thanks for all your hints.

From the user's point of view, the problem is quite simple: all his files
are on the same PC, he uses only one embedding level.
But his has a lot of sub projects and a lot of master projects. His need is
to check if the active project he is working on, is already inserted in a
master project (me be he forgot to insert this subproject), and what is the
name of this master project, avoiding the tedious search in the masters.

Newbie
 
J

John

Newbie said:
Hi every body,
Thanks for all your hints.

From the user's point of view, the problem is quite simple: all his files
are on the same PC, he uses only one embedding level.
But his has a lot of sub projects and a lot of master projects. His need is
to check if the active project he is working on, is already inserted in a
master project (me be he forgot to insert this subproject), and what is the
name of this master project, avoiding the tedious search in the masters.

Newbie

Newbie,
Given the scenario it shouldn't be to big a deal to automate a search of
every .mpp on his PC to find out which have inserted projects and
exactly which subrprojects are inserted into which master. Once that is
done, I suggest a spare text field or perhaps the comment box in the
File Properties (File/Properties) be used to store the information. Or,
an even quicker reference can be set up in an Excel spreadsheet. Since
this process should be a one-shot deal, it doesn't even need to be
automated, although that might improve accuracy compared to a manual
search. In the end the user needs to establish good documentation and
keep it updated. I use a similar scheme to keep track of updates and
revisions to all my macros.

Hope this helps.
John
Project MVP
 
N

Newbie

Hi John,

John said:
Newbie,
Given the scenario it shouldn't be to big a deal to automate a search of
every .mpp on his PC to find out which have inserted projects and
exactly which subrprojects are inserted into which master. Once that is
done, I suggest a spare text field or perhaps the comment box in the
File Properties (File/Properties) be used to store the information. Or,
an even quicker reference can be set up in an Excel spreadsheet. Since
this process should be a one-shot deal, it doesn't even need to be
automated, although that might improve accuracy compared to a manual
search. In the end the user needs to establish good documentation and
keep it updated. I use a similar scheme to keep track of updates and
revisions to all my macros.

Hope this helps.
John
Project MVP

So, as Jan said previously, thre's no direct solution within the
subprojects.
How could you find (with VBA) that a project (which is in fact a master) has
any inserted projects ?
Thanks a lot,

Newbie
 
R

Rod Gill

Try:
Dim Proj As Project
For Each Proj In ActiveProject.Subprojects
MsgBox "Subproject: " & Proj.Name
Next Proj
 

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