locked
Connect to Resource Pool Event?? RRS feed

  • Question

  • In MSP, it's nowhere clear whether a file is using a resource pool or not. So, I created a small macro that adds this info to the status bar. When the user connects to the a resource pool, this macro would have to "fire" to update the status bar, but I cannot find out how to catch this "event"

    Thanks for the help!

    Statusbar macro works like this:

    ========================

    On Error GoTo Errhandler
        err = MSProject.Application.ResourceSharingPoolRefresh 'Error if not connected
        strPoolName = "Connected to: " & ActiveProject.ResourcePoolName
        GoTo PoolConnected 'skip Errhandler
       
    Errhandler:
        strPoolName = "File is not connected to a Resource Pool"
       

    PoolConnected:

    Application.StatusBar = strPoolName

    ========================

    Thursday, December 21, 2017 12:34 PM

Answers

  • Andre,

    Examine the Project field in the pool file Resource Sheet. It identifies which assignment is associated with which sharer file. For example, here is a screen shot of my test pool file. It has two sharer files but at the moment, only the Sharer2 file is connected to the pool and this is reflected in the Project field of the pool file for active assignment rows.

    Hope this helps.

    John

    • Marked as answer by Huismu5 Friday, December 22, 2017 4:01 PM
    Thursday, December 21, 2017 6:12 PM

All replies

  • Andre,

    As far as I know, there is no event that will fire upon connection to the pool. However, you can tell if a sharer file is connected to the pool. Take a look at the Project field on the Resource Sheet. If the file is connected to the pool, the name of the pool will appear in the Project field. If the file is not connected to the pool, the filename itself will appear in the Project field. You should be able to use this in Open event macro to set the Status Bar, or if the pool isn't fully connected until the Activate event, then use the latter.

    Hope this helps.

    John

    Thursday, December 21, 2017 2:48 PM
  • Hi John,

    Thanks for your prompt reply. You're right, my other post is an asking about an alternative solution to the same problem. If I understand you correctly, I can use the Open Event of the Resource Pool opening to run a macro in the project file im connecting from. However, how would I identify the correct project object? E.g.:

    ============================

    strProjectName = ????? 'how to get the correct project name?

    Application.Run ("'" & strProjectName & "'!macroname")

    ==============================

    If the PM has multiple project files open, it's impossible to tell which project file is being connected to the Resource Pool.

    Thursday, December 21, 2017 4:27 PM
  • Andre,

    Examine the Project field in the pool file Resource Sheet. It identifies which assignment is associated with which sharer file. For example, here is a screen shot of my test pool file. It has two sharer files but at the moment, only the Sharer2 file is connected to the pool and this is reflected in the Project field of the pool file for active assignment rows.

    Hope this helps.

    John

    • Marked as answer by Huismu5 Friday, December 22, 2017 4:01 PM
    Thursday, December 21, 2017 6:12 PM