Is there a way to tell if MS Project Pro is connected to Project Server?

  • Thread starter George Hepworth
  • Start date
G

George Hepworth

I'm being tasked with working with MS Project (2007) and Project Server.

One of the process I need to run is dependent on whether MS Project Pro is
connected to the Project Server or not. I learned today that one of the
users habitually start PP without connecting to Project Server which means
my code doesn't have access to enterprise fields.

Is there any way, in VBA, to tell if the currently open project is connected
to the Project Server?

Being new to this, I may not have all the nuances and terminology under
control so don't hesitate to drill me for details.

Thanks in advance.
George
 
R

Rod Gill

Hi,

Try application.GetProjectServerVersion

It throws an error is there isn't a valid server attached.

Sub mpsVersion()
URL = ActiveProject.ServerURL
If Application.GetProjectServerVersion(URL) = pjServerVersionInfo_P10
Then
ActiveProject.MakeServerURLTrusted
xmlStream = Application.GetProjectServerSettings( _
RequestXML:="<ProjectServerSettingsRequest>" _
& "<AdminDefaultTrackingMethod /><AdminTrackingLocked />" _
& "<ProjectIDInProjectServer />" _
& "<ProjectManagerHasTransactions />" _
& "<ProjectManagerHasTransactionsForCurrentProject />" _
& "<TimePeriodGranularity /><GroupsForCurrentProjectManager />" _
& "</ProjectServerSettingsRequest>")
MsgBox xmlStream
Else
MsgBox "This macro returns information from Project " _
& "Server. Please choose 'Collaborate using Project " _
& "Server' and specify a valid Project Server URL " _
& "for this project in Collaboration Options (Collaborate menu)."
Exit Sub
End If
End Sub

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




George Hepworth said:
I'm being tasked with working with MS Project (2007) and Project Server.

One of the process I need to run is dependent on whether MS Project Pro is
connected to the Project Server or not. I learned today that one of the
users habitually start PP without connecting to Project Server which means
my code doesn't have access to enterprise fields.

Is there any way, in VBA, to tell if the currently open project is
connected to the Project Server?

Being new to this, I may not have all the nuances and terminology under
control so don't hesitate to drill me for details.

Thanks in advance.
George

__________ Information from ESET Smart Security, version of virus
signature database 4916 (20100304) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4916 (20100304) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 
G

George Hepworth

Thank you. I was beginning to think I might have to do something like that.
I'll let you know how this works out.

George
 
R

Rod Gill

Happy coding!!

--

Rod Gill
Microsoft MVP for Project - http://www.project-systems.co.nz

Author of the only book on Project VBA, see: http://www.projectvbabook.com




George Hepworth said:
Thank you. I was beginning to think I might have to do something like
that. I'll let you know how this works out.

George





__________ Information from ESET Smart Security, version of virus
signature database 4916 (20100304) __________

The message was checked by ESET Smart Security.

http://www.eset.com

__________ Information from ESET Smart Security, version of virus signature database 4916 (20100304) __________

The message was checked by ESET Smart Security.

http://www.eset.com
 

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