Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code to open MS project from EXCEL

Status
Not open for further replies.

komark

Technical User
Sep 12, 2005
134
US
Hi,
I need to open up MS Project Professional. In a excel spreadsheet (under column A) I have the names of the enterprise projects that I want to open. For some reason it is not doing anything.

Can anyone help me?





Sub OpenFile()
'deleting the first row
Rows("1:1").Select
Selection.Delete Shift:=xlUp

Dim Projects As Object
Dim Winproj As Application

'running a loop
Application.ScreenUpdating = False
For x = 1 To 1000 Step 1
If Range("A" & x) = Not (Null) Then

Set Range("A" & x).Copy = Projects
Set Winproj = New MSProject.Application

'Winproj.ActiveWindow.Activate
Winproj.Visible = True
Winproj.ActiveWindow.Activate
Workbooks.Open Filename:=("<>\" & Projects)


End If

Next




End Sub
 
I don`t have M$-Project installed but this looks like an automation issue, so try something like

Dim Winproj As Object

Set Winproj = CreateObject("MSProject.Application")

So Winproj is an instance of M$-Project. There should be a method to open a M$-Project file. You ´ll have to explore the object browser of the according library ...
 
Yes I need help in opening up enterprise projects
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top