AddResourcesFromProjectServer Method
Opens the Build Team dialog box if you are connected to Project Server and are currently in a resource view.
Syntax
expression**.AddResourcesFromProjectServer**
*expression * Optional. An expression that returns an Application object.
Remarks
The AddResourcesFromProjectServer method is only available in resource views and returns a trappable error (error code 1100) when applied in a non-resource view.
Example
The following example displays the Build Team from Project Server dialog box. First, Project adds the URL specified in Collaboration Options (Collaborate menu) to Microsoft Internet Explorer's list of trusted sites. Upon confirmation, Project switches to a Resource Sheet view and displays the Build Team from Project Server dialog box, if connected to My Computer in workgroup mode. Project displays the Build Team from <Project Name> dialog box when connected to Project Server.
Sub AddResources()
If Projects.Count = 0 Then
MsgBox "You must have at least one active project open."
Exit Sub
End If
If ActiveProject.ServerURL = "" Then
MsgBox "A Project Server URL has not been " _
& "specified." & Chr(13) & "Click OK to select " _
& "'Collaborate Using Project Server' and " _
& "specify a valid URL in the Options dialog box " _
& "(Tools menu)."
Application.OptionsWorkgroup
Else
ActiveProject.MakeServerURLTrusted
ViewApply Name:="Resource Sheet"
Application.AddResourcesFromProjectServer
End If
End Sub
Applies to | Application Object
See Also | EnterpriseTeamBuilder Method | UpdateFromProjectServer Method