Project_BeforeClose \ Cancel to close RRS feed

  • Question

  • Hello,

    i try to cancel closing mpp file using the Project_BeforeClose event. 

    Is it possible to cancel closing the project file when the cancel button is hit ?


    Private Sub Project_BeforeClose(ByVal pj As Project)
        Dim Msg As String
        Dim answer As String
        Msg = "Message."
        answer = MsgBox(Msg, vbOKCancel, "Fichier de ressources")
        If answer = vbCancel Then
            MsgBox ("No!!")
            MsgBox ("Yes!!")
        End If
    End Sub
    I found, function "ProjectBeforeClose2" may helps me https://msdn.microsoft.com/en-us/library/office/aa204890(v=office.11).aspx

    Monday, April 11, 2016 3:44 PM