Application.AddResourcesFromProjectServer method (Project)

Opens the Build Team dialog box if you are connected to Project Server and are currently in a resource view.

Syntax

expression. AddResourcesFromProjectServer

expression A variable that represents an Application object.

Return value

Boolean

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

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.