Link to home
Start Free TrialLog in
Avatar of eciabattari
eciabattari

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of oleggold
oleggold
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial