none
Launching Project Professional 2010 client from Access 2007 application RRS feed

  • Question


  • Hello,

    I need to launch Project Professional 2010 Client from my Access application. In the VB code, I have the ProjectUID available for the project that needs to be opened in Project Professional 2010 Client. From a different part of the application I am able to open a particular project file from my PS 2010 server by using the URL (along with the ProjectUID). Apparently, the same is not possible when launching Project Professional 2010 client.

    If anyone has done this before, could you please share the snippet of VB code that does it? Just to reiterate, my application is written in Access 2007.

    Thanks in advance.

    HeliosRex

    Thursday, May 3, 2012 7:45 PM

All replies

  • Here you go, straight out of my Project VBA book:

    Sub StartProject()
    'Requires Reference to Microsoft Project
    Dim projApp As MSProject.Application
    	On Error Resume Next
    	'Start Project
    	Shell "winproj.exe /s http://ServerName/ProjectServerName/"	
    	Do Until Not (projApp Is Nothing)			'Wait for Project to connect
    		DoEvents
    		Set projApp = GetObject(, "MSProject.Application")
    	Loop
    	Debug.Print projApp.Name    'Debug.Print sends message to Immediate Window
    	Debug.Print projApp.Profiles.ActiveProfile.ConnectionState
    	projApp.Quit
    	Set projApp = Nothing
    End Sub
    
    You have to use the Shell command to start Project so you can pass the Server name to it on start up. This code uses Windows authentication, but /u and /p parameters (I thin) allow passing a user name and password.

    This code should work in any version of any Office application.


    Rod Gill

    The one and only Project VBA Book

    Rod Gill Project Management

    Thursday, May 3, 2012 9:11 PM
    Moderator
  • Rod,

    Thanks for the quick reply. Along with the server information, how can I pass a particular ProjectUID so that it connects to the server and opens a project (with ProjectUID passed) in the client?

    HeliosRex

    Thursday, May 3, 2012 9:48 PM
  • Now you use the ProjApp to control everything and everything in Project.

    Simplest way to learn is to record a macro of you opening a project from Project Server. All you need is the Project Title. If you only have a GUID then you need to used OLEDB to read the title from the Reporting db.

    Note: when recording a macro, Choose This Project for macro Store location as you don't want to fill the Global.Mpt with recorded macros.


    Rod Gill

    The one and only Project VBA Book

    Rod Gill Project Management

    Friday, May 4, 2012 1:16 AM
    Moderator