none
Use the BeforeSave event for a message RRS feed

  • Question

  • I would like to have a reminder in a message box fire on the Save As event? I have tried and the code debugs but does not work when I save or save as.

    Pj Pro 2007, Pj Server 2007

    Thanks,

    Rick

    Wednesday, September 29, 2010 4:41 PM

Answers

  • Hi rixmcx59,

    Have you added the macro correctly to the Enterprise Global Template? Have you closed and re-opened Microsoft Project after saving the macro's to the EGT?

    Do other events fire correctly? Have you checked the macro security settings of the EGT?

    Hans


    My EPM blog: Projectopolis
    Wednesday, September 29, 2010 7:53 PM
    Moderator
  • The code works fine on the machines where I tried it.  It is important to load it into the Global templates, then it works fine.

    Jim


    If you feel this post answered the question, please vote for it. I am also available here:
    msprojectblog.com
    • Marked as answer by rixmcx59 Thursday, September 30, 2010 3:43 AM
    Wednesday, September 29, 2010 8:28 PM
    Moderator

All replies

  • Hi,

    You have to put macro security to Low.

    Wednesday, September 29, 2010 5:30 PM
    Moderator
  • Public Sub Project_BeforeSave(ByVal pj As Project)

    MsgBox ("Please do not save  Enterprise Projects to external drives")


    End Sub

    Macro security is set to low, I imagine I have left something out.

    Wednesday, September 29, 2010 5:52 PM
  • Hi,

    Don't know whether that is important but I always see event driven macros defined as Private Sub.

    Wednesday, September 29, 2010 7:46 PM
    Moderator
  • Hi rixmcx59,

    Have you added the macro correctly to the Enterprise Global Template? Have you closed and re-opened Microsoft Project after saving the macro's to the EGT?

    Do other events fire correctly? Have you checked the macro security settings of the EGT?

    Hans


    My EPM blog: Projectopolis
    Wednesday, September 29, 2010 7:53 PM
    Moderator
  • Hi  rixmcx59,

    i add to you another question: have you put this macro in a ClassModule ?

    Have you add a statement like this Public WithEvents oProject As Application for catch event?

    I hope this can help you

    Cheers,

    Paolo O.

    Wednesday, September 29, 2010 8:14 PM
  • The code works fine on the machines where I tried it.  It is important to load it into the Global templates, then it works fine.

    Jim


    If you feel this post answered the question, please vote for it. I am also available here:
    msprojectblog.com
    • Marked as answer by rixmcx59 Thursday, September 30, 2010 3:43 AM
    Wednesday, September 29, 2010 8:28 PM
    Moderator