22 | 02 | 2017

Iterate Through Subprojects

If you have multiple sub projects within a project than it is possible to iterate through these project using the code below:

Sub OpenSubProject()

'****************************************
'*** Code from VisibleVisual.com ********
'****************************************

Dim project2 As Project 'sub project
Dim project1 As Project 'main project
Set project1 = ActiveProject

For Each Subproject In project1.Subprojects
    FileOpen (Subproject.Path)
    Set project2 = ActiveProject
    MsgBox project2.Name
        For Each Task In project2
        MsgBox Task.Name
        'do something for every task in the subproject
        Next Task
Next Subproject

project1.Activate

End Sub

 

 

Login

Sign up now and upload your code to the website.

Help us to continue.....
Statistics
Articles View Hits
2174907
Latest Articles