Publishing subprojects without saving or publishing their master

A

AaronD

Greetings,

We recently discovered that you can highlight multiple projects from
Project Server 2007 PWA's Project Center and open them all at once in
Project 2007. When doing this, Project opens with a temporary (e.g
Project1 or Project2, etc...) master project, with each of the
selected projects as a subproject.

This is great, since it allows project managers to filter/group/sort
all of the projects, select the ones they want and then open them all
at once to make changes across them, rather than trying to make the
changes to one project at a time.

What we can't currently figure out, however, is how to publish the
changes made to projects opened like this.

1) If you just close the temporary master, you'll be prompted to save
the sub-projects, which gets us half-way there
2) It seems like these projects are then saved but un-published, which
doesn't really save a step since the PM would then have to open them
each individually anyway to publish them.

I'm wondering if there is some way I'm missing to BOTH save and
publish the sub-projects without getting stuck with a bunch of un-
wanted master projects?

Thanks,
Aaron
 
D

Dale Howard [MVP]

AaronD --

The only ways you can publish subprojects of a master project are:

1. Save the master project and then publish it. This will publish each of
the subprojects as well.

2. Open each subproject file individually and publish it.

Since you are using temporary master projects and not saving them, that
pretty well eliminates #1 above as an option. Hope this helps.
 
A

AaronD

Hi Dale,

Thanks for the reply - do you know of any sample VBA script that would
show how to force the publish of a project via a macro from Project
2007 Pro? We'd like to be able to do this anyway since some PM's are
forgetful and we don't really need the draft vs. published distinction
in our setup.

Thanks again,
Aaron
 
J

Jonathan Sofer [MVP]

Hi Aaron,

Here is a macro for your reference. This was created by my good friend Jack
Dahlgren who is a Project MVP.

It requires you have project open and connected to the server. It also
requires an excel file be called "filelist.xls" and should be stored in the
root directory "c:\". The excel file should have the list of projects with
the project name in the first row.

Sub publishAllProjects()
'Before running make sure you go to tools menu, references and
'make sure that the Microsoft Excel Object Library is checked
Dim xlApp As New Excel.Application
Dim xlwb As Excel.Workbook
Dim xlSht As Excel.Worksheet
Dim myRange As Excel.Range
Dim myRes As Resource 'used for deleting or working with resources
Dim mypfile As String 'used for name of project
Set xlwb = xlApp.Workbooks.Open("c:\filelist.xls")
Set xlSht = xlwb.Sheets(1)
Dim myLastRow As Integer
MSProject.Application.ScreenUpdating = False
'to do:
'build array from excel file and close excel or use text file
'write log
'check for last publish or last save date
'build dialog for date range
'Figure out how many lines in spreadsheet
Range("A1").Select
On Error Resume Next
myLastRow = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
Range("A1").Select
'loop through all projects in list
For i = 1 To myLastRow
'read the project name into the filename variable
mypfile = xlApp.ActiveCell.Value
'hide the alerts and confirmations dialogs
DisplayAlerts = False
'Open the file from the server
FileOpenEx Name:="<>\" & mypfile, ReadOnly:=False
'Check if read only. If not, then do the things in the loop
If Not ActiveProject.ReadOnly Then
Application.CalculateProject
Publish
'write that the project has been published
xlApp.ActiveCell.Offset(0, 1).Select
xlApp.ActiveCell.Value = "Published"
xlApp.ActiveCell.Offset(0, -1).Select
End If
FileCloseEx
'Get next row of project file
xlApp.ActiveCell.Offset(1, 0).Select
Next
'xlwb.Close
'xlApp.Quit
xlApp.ActivateMicrosoftApp
End Sub

Hope this helps,

Jonathan Sofer

Hi Dale,

Thanks for the reply - do you know of any sample VBA script that would
show how to force the publish of a project via a macro from Project
2007 Pro? We'd like to be able to do this anyway since some PM's are
forgetful and we don't really need the draft vs. published distinction
in our setup.

Thanks again,
Aaron
 
G

Gérard Ducouret

Hi everybody,

You can also use the Projtool which allow you to publish several selected
files. The Project SDK download installs the ProjTool files.
http://msdn.microsoft.com/en-us/library/aa494895.aspx

Gérard Ducouret

Jonathan Sofer said:
Hi Aaron,

Here is a macro for your reference. This was created by my good friend
Jack Dahlgren who is a Project MVP.

It requires you have project open and connected to the server. It also
requires an excel file be called "filelist.xls" and should be stored in
the root directory "c:\". The excel file should have the list of projects
with the project name in the first row.

Sub publishAllProjects()
'Before running make sure you go to tools menu, references and
'make sure that the Microsoft Excel Object Library is checked
Dim xlApp As New Excel.Application
Dim xlwb As Excel.Workbook
Dim xlSht As Excel.Worksheet
Dim myRange As Excel.Range
Dim myRes As Resource 'used for deleting or working with resources
Dim mypfile As String 'used for name of project
Set xlwb = xlApp.Workbooks.Open("c:\filelist.xls")
Set xlSht = xlwb.Sheets(1)
Dim myLastRow As Integer
MSProject.Application.ScreenUpdating = False
'to do:
'build array from excel file and close excel or use text file
'write log
'check for last publish or last save date
'build dialog for date range
'Figure out how many lines in spreadsheet
Range("A1").Select
On Error Resume Next
myLastRow = Cells.Find("*", [A1], , , xlByRows, xlPrevious).Row
Range("A1").Select
'loop through all projects in list
For i = 1 To myLastRow
'read the project name into the filename variable
mypfile = xlApp.ActiveCell.Value
'hide the alerts and confirmations dialogs
DisplayAlerts = False
'Open the file from the server
FileOpenEx Name:="<>\" & mypfile, ReadOnly:=False
'Check if read only. If not, then do the things in the loop
If Not ActiveProject.ReadOnly Then
Application.CalculateProject
Publish
'write that the project has been published
xlApp.ActiveCell.Offset(0, 1).Select
xlApp.ActiveCell.Value = "Published"
xlApp.ActiveCell.Offset(0, -1).Select
End If
FileCloseEx
'Get next row of project file
xlApp.ActiveCell.Offset(1, 0).Select
Next
'xlwb.Close
'xlApp.Quit
xlApp.ActivateMicrosoftApp
End Sub

Hope this helps,

Jonathan Sofer

Hi Dale,

Thanks for the reply - do you know of any sample VBA script that would
show how to force the publish of a project via a macro from Project
2007 Pro? We'd like to be able to do this anyway since some PM's are
forgetful and we don't really need the draft vs. published distinction
in our setup.

Thanks again,
Aaron

AaronD --

The only ways you can publish subprojects of a master project are:

1. Save the master project and then publish it. This will publish each of
the subprojects as well.

2. Open each subproject file individually and publish it.

Since you are using temporary master projects and not saving them, that
pretty well eliminates #1 above as an option. Hope this helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top