SaveAs Code

R

Red

Can anyone suggest why when I step through the below code is works fine but
when run from the macro in project it appears to stop before the MsgBox.

Thanks

For Each p In application.Projects
If Not p Is Nothing Then
If p.Name <> "Definite ResPool" Then
If p.Tasks.Count > 0 Then
p.Activate
application.ActiveWindow.Caption = "Saving Contribution
data to Excel"
SelectTaskColumn Column:="Name"
OutlineHideSubTasks
p.SaveAs APRoot & "All Definite", pjXLS, , , , , , , , ,
"Contribution"
End If
End If
End If
Next p

MsgBox "The Data transfer to Excel is complete. To view contribution by
project" & _
Chr(13) & "select Reporting \ Job Performance \ Contribution Report in
Access", _
vbInformation, "Contribution Data Export"



--

Regards,

Gina


HTA Architects
Tel: 020 74828054
Email: (e-mail address removed)
 
J

Jack D.

Red said:
Can anyone suggest why when I step through the below code is works fine
but when run from the macro in project it appears to stop before the
MsgBox.

Thanks

For Each p In application.Projects
If Not p Is Nothing Then
If p.Name <> "Definite ResPool" Then
If p.Tasks.Count > 0 Then
p.Activate
application.ActiveWindow.Caption = "Saving
Contribution data to Excel"
SelectTaskColumn Column:="Name"
OutlineHideSubTasks
p.SaveAs APRoot & "All Definite", pjXLS, , , , , , ,
, , "Contribution"
End If
End If
End If
Next p

MsgBox "The Data transfer to Excel is complete. To view contribution
by project" & _
Chr(13) & "select Reporting \ Job Performance \ Contribution Report in
Access", _
vbInformation, "Contribution Data Export"

Perhaps it is running into a problem with saving one of the files and is
never getting there. How many of the open projects are saved?

--
Please try to keep replies in this group. I do check e-mail, but only
infrequently. For Macros and other things check http://masamiki.com/project

-Jack Dahlgren, Project MVP


+++++++++++++++++++
 

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