Create instance MsProject.Application throws "Online Profile required" - error RRS feed

  • Question

  • Dear readers,

    when I try to create an instance  

    MsProject.Application inst = new MsProject.Application();

    the following happens:

    a) MsProject opens and shows a dialog  TPG ProjectLionk 2010, ProjectServer: Online Profile required"

    b) the statement above throws an exception

    Who has a idea?

    • Edited by Somigur Thursday, April 30, 2015 2:03 PM
    Thursday, April 30, 2015 12:38 PM

All replies

  • When Project Pro starts I suspect it is immediately trying to login to Project Server and the login username is not a user on Project Server.

    Try logging in with a user name that is a project server user with the following code. Its in VBA but should be easy to convert to VB.Net:

    Sub StartProject()
    'Requires Reference to Microsoft Project
    Dim projApp As MSProject.Application
        On Error Resume Next
        Shell "winproj.exe /s http://ServerName/ProjectServer/"
        Do Until Not (projApp Is Nothing)
            Set projApp = GetObject(, "MSProject.Application")
        Debug.Print projApp.Name
        Debug.Print projApp.Profiles. _
        Set projApp = Nothing
    End Sub

    Rod Gill
    Author of the one and only Project VBA Book

    Friday, May 1, 2015 9:37 PM