none
Is there a way to display event handler "Error message" in MPP? RRS feed

  • Question

  • Hi,

    Currently, we can show the event handler error messages on the PWA schedule page but how can we show the same message in  MPP.

    For ex: If perform some validations on the publishing event, if there are any validation errors, its possible to display on the PWA schedule page immediately but how can I show the same error msg in MPP? As we all know that In reality, Project managers would prefer to use MPP rather than using PWA to work with the schedules. 

    We can write these message in somewhere like (custom field / SharePoint list/ database etc..) and we can show them to the end user with a report or email notification but the customer doesn't want that, he wanted to see the error message t on the screen every time when he publish the project.

    Please let me know if there is any way to achieve it. 



    Thursday, February 28, 2019 10:20 AM

All replies

  • Hi Rajkumar,

    To do that, you would need some code that "lives inside" MS Project and listens for validation-error events that it raises.  There are several ways to do this:  writing a COM Add-In in C# or VB is the older, stand-by way of doing this.  This Add-In would load into memory when MS Project opens and would listen for validation errors in the Project Object Model.  When the error is detected, your Add-In code could display a message to the user.  I have done quite a bit of COM Add-Ins for MS Project.

    Maybe an easier way would be to look into VSTO technology, meaning Visual Studio Tools for Office.   These have also been around for a while and are written in C# or VB.  For both COM Add-Ins and VSTO, you should look up the book and blogs of Andrew Whitechapel.

    The third, and maybe easiest approach would be to write something in VBA that listens for events on the Project Object Model.  I have not done this sort of thing, but there's a very good book by Rod Gill on VBA for Project.


    ...Jim Black

    Sunday, March 3, 2019 8:06 PM
  • Cant you just use a message box for errors?

    Michael Wharton, Project MVP, MBA, PMP and a Great Guy <br/> Website http://www.WhartonComputer.com <br/> Blog http://MyProjectExpert.com contains my field notes and SQL queries

    Monday, March 4, 2019 3:34 AM
    Moderator
  • Yes, and some piece of code with access to the Project Object Model has to detect the error and display the message box.  

    ...Jim Black

    Monday, March 4, 2019 4:54 AM
  • Hi,

    Thanks for your response. Have explained all the client side possibilities  (like Custom VBA code, VSTO add-ins etc..) to my client earlier before I post this query on the forum but they don't want anything to be developed for client application side as it requires to be configured/installed for each and every client application. 

    The schedule validation rules that I'm performing are little complex and not straight forward with the current project but with current project against to multiple project Templates (as we are creating a dynamic project by merging multiple templates on the project creation). So  on every publishing event I need to run this Rules (validation + Quality Analysis) across current project Vs corresponding templates. 

    However, I came up with some different Idea, now my client agreed for that hence we are moving forward with that.

    Thank you very much Jim & Michael for your inputs.


    Monday, March 4, 2019 8:57 AM