MS Project - Not Visable

Hi,

When using VBA within MSProject, I've written the following code and it will open MSProject file but not make visable.  What am I doing wrong?

Thanks,

Private Sub ExecuteCompare()

Dim iProjectPrimary As MSProject.Project
Dim iProjectCompare As MSProject.Project
Dim strProjectPrimary as String
Dim strProjectCompare as STring

    strProjectPrimary = "\\HOUIC-S-01117\XXXXX\My Documents\X_Files\Planning\BPMA\Sub-teams\Project1.mpp"
    strProjectCompare = "\\HOUIC-S-01117\XXXXX\My Documents\X_Files\Planning\BPMA\Sub-teams\Project2.mpp"

    Set iProjectPrimary = GetObject(strProjectPrimary)
    Set iProjectCompare = GetObject(strProjectCompare)
    iProjectPrimary.Application.Visible = True

End Sub
eciabattariAsked:
Who is Participating?
 
oleggoldConnect With a Mentor Commented:
there should be smth like iProjectPrimary.Application.Wimdow.State=<Maximized>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.