21 | 09 | 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


End Sub




Sign up now and upload your code to the website.

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