MS Project 2013: VBA Project_Open() Event not fired when opening an empty template from via...

Diskutiere und helfe bei MS Project 2013: VBA Project_Open() Event not fired when opening an empty template from via... im Bereich Microsoft Office im Windows Info bei einer Lösung; Hi, I am using the Project_Open() Method to install my user-defined ribbons/makros. I placed the following vba-code in the global.mpt file to make... Dieses Thema im Forum "Microsoft Office" wurde erstellt von karl2509, 6. April 2018.

  1. karl2509
    karl2509 Gast

    MS Project 2013: VBA Project_Open() Event not fired when opening an empty template from via...


    Hi,


    I am using the Project_Open() Method to install my user-defined ribbons/makros.

    I placed the following vba-code in the global.mpt file to make sure that my ribbons/makros are available in every project-file:

    Sub Project_Open(ByVal pj As Project)
    MsgBox "Hello World"
    If Not pj Is Nothing Then
    AddOrRefreshMenu_Monitor
    End If
    End Sub



    As long as I open a project file the MsgBox appears. The method Project_Open() is called correctly.


    But when I open a new empty project template via 'MainMenu -> New -> Empty Project' I do not get the MsgBox any more.


    In fact the method Project_Open() does not get called.

    If you save this file and reopen it with MS Project it works fine. The method is called again.


    It seems that opening an empty Project-Template doesn't fire the Project_Open() method.

    I tried several templates which are also available via 'MainMenu->New'. Those are working correctly.


    It seems that this behaviour is limited to the Empty Project-Template.


    In my opinion the Project_Open() should also get called. It that correct?


    MS Project-Version: Microsoft© Project 2013 (15.0.5015.1000) MSO (15.0.5015.1000) 32-Bit Microsoft Office
     
  2. Karl Graber Win User

    MS Project 2013: VBA Project_Open() Event not fired when opening an empty template from via New->Empty Project

    Hi Barbara,

    The workaround is working fine.

    But as you already noted the solution only covers "additional opened projects".

    It is not working when you initially open MS Project with a project-File.

    I'm going to use a combination of both (Project_Open() and your work-around).

    This question may be closed as "answered" by someone.

    Thanks a lot,

    Karl
  3. Barbara Henhapl Win User

    MS Project 2013: VBA Project_Open() Event not fired when opening an empty template from via New->Empty Project

    Hi,

    I can reproduce this issue. But there is a work around:

    Create a class module (I called it clsEvents) and add the following code:

    Public WithEvents ProjApp As MSProject.Application

    Private Sub ProjApp_NewProject(ByVal pj As Project)

    MsgBox "Do what you need to do on Project_Open"

    End Sub

    Create a (normal) module with this code:

    Public ProjEvents As New clsEvents

    Sub EnableEvents()

    Set ProjEvents.ProjApp = MSProject.Application

    End Sub

    Add the following code in your ThisProject(Global.mpt)

    Private Sub Project_Activate(ByVal pj As Project)

    Call EnableEvents

    End Sub

    Project_Activate is fired on each project change, also for creating projects from any template. This will enable events calling procedure EnableEvents. The events are in the class module. After enableing events, you have a lot to choose from (also task,
    resource and assignment events). I used "NewProject". Note: this does not mean " a new project is created" but "an additional project is opened"

    Here some additional information:
    https://msdn.microsoft.com/en-us/library/ee355232(v=office.12).aspx
    It is still applicable for current versions.

    Does that work for you?

    Barbara
  4. Karl Graber Win User

    MS Project 2013: VBA Project_Open() Event not fired when opening an empty template from via New->Empty Project

    This is the screenshot where my method is located in global.mpt


    [​IMG]
  5. Eric Hindrichsen (As Win User

    ProjectBeforeTaskChange-Ereignis wird beim Löschen eines Wertes nicht ausgelöst

    Hallo Pauline,

    vielen Dank für den Hinweis. Ich hatte im Vorfeld zu meiner Anfrage hier im englischen MSDN-Forum bereits ein Thema eröffnet, das bisher leider nicht zufriedenstellend beantwortet werden konnte. Der Vollständigkeit halber hier trotzdem der Link zum Thema:

    [MS Project] ProjectBeforeTaskChange event not fired on value deleted

    Hoffnungsvolle Grüße,

    Eric
  6. Rani Nguyen Win User

    Word into PDF

    Hi AnnaThomas,
    Thanks for your reply. After opening the "Finder" and opening "Home" from the "Go" menu, there is no "Library". Am I searching in the wrong place? I also tried searching for the file "com.microsoft.Word.plist" via "Go to Folder", but it could not be found.
    Cheers!
  7. User Advert


    Hi,

    willkommen im Windows Forum!
Thema:

MS Project 2013: VBA Project_Open() Event not fired when opening an empty template from via... - Microsoft Office

Die Seite wird geladen...

MS Project 2013: VBA Project_Open() Event not fired when opening an empty template from via... - Similar Threads - Project 2013 VBA

Forum Datum

Prohibiting One Note from opening folders as „Notebooks“

Prohibiting One Note from opening folders as „Notebooks“: Hey guys,we have a problem with One Note, specially the .onetoc2 Files are everywhere on our servers because some users whyever open the folder rather than a local notebook file. This made us many...
Microsoft Office 5. März 2024

MS Projects Template standard ist "öffnen" statt "neu"

MS Projects Template standard ist "öffnen" statt "neu": Hallo, wir haben neuerdings das Hinderniss gefunden, dass MS Projekts Templates mpt mit "öffnen" öffnet statt wie bei jedem Template Format mit "neu". Dies ist leider sehr ärgerlich falls man...
Microsoft Office 22. Februar 2024

PowerPoint crashes when opening a Presentation from Microsoft Teams

PowerPoint crashes when opening a Presentation from Microsoft Teams: My PowerPoint crashes when I open a PowerPoint presentation from Microsoft Teams. After force quitting, I get the following error code:Microsoft Error Reporting log version: 2.0Error...
Microsoft Office 12. Mai 2023

Project not opening after opening and closing 5 times

Project not opening after opening and closing 5 times: Hi guys,in our company we are using Citrix Virtual Apps and Virtual Desktop. We have discovered a "bug" in the program MSProject inside Citrix Virtual Desktop 7 and in the other OSs/PCs like...
Microsoft Office 31. März 2023

MS Project 2013

MS Project 2013: Seit 2017 nutze ich MS Project 2013, und möchte dieses Programm auf meinem neuen Surface Book 2 weiter nutzen. Doch leider besteht derzeit keine Möglichkeit, das Setup-Programm aus dem Internet zu...
Microsoft Office 16. Juni 2018

MS Project 2016 öffnen via VBA Makro im Excel 2016

MS Project 2016 öffnen via VBA Makro im Excel 2016: Hallo Ich habe ein Makro in MS Project 2016, dieses soll via Excel aufgerufen werden. Das Makro funktioniert im Project, nun hab ich mich ans Excel-Makro gemacht, jedoch kann ich da nicht mal MS...
Microsoft Office 20. August 2017

MS Project 2013

MS Project 2013: Hallo, seit einpaar Tagen kämpfe ich mit dem Gantt-Diagramm. Ich möchte, dass der Balken-Rollup automatisch dargestellt wird. Allerdings werden dann die Balken, die nah aneinander liegen...
Microsoft Office 9. November 2016
MS Project 2013: VBA Project_Open() Event not fired when opening an empty template from via... solved
  1. Diese Seite verwendet Cookies, um Inhalte zu personalisieren, diese deiner Erfahrung anzupassen und dich nach der Registrierung angemeldet zu halten.
    Auf dieser Website werden Cookies für die Zugriffsanalyse und Anzeigenmessung verwendet.
    Wenn du dich weiterhin auf dieser Seite aufhältst, akzeptierst du unseren Einsatz von Cookies.