1 Reply Latest reply on Jul 31, 2013 2:14 PM by mjohnson

    Does Application_ProjectChanged() Work?

    mjohnson

      I need to do some processing when changing projects, and I'm having a problem with this one. I wrote some simple code to test it, and I'm not getting the results I expect. I load this at startup, and then open and close projects to test it. I tried ProjectChanged with and without the input (since I'm not using it). In neither case does the MsgBox or AppendOutput trigger, but the BeforeProjectChanged triggers when I expect it to. Any thoughts?

       

      1. Load project

      2. "BPC" output occurs

      3. Change project by clicking on another recent project in the file menu

      4. No output.

       

      Scripting.DontExit = TRUE

      Sub Application_BeforeProjectChanged()
        AppendOutput "Output","BPC"
      End Sub

       

      Sub Application_ProjectChanged(GetProjectData)
        MsgBox "Project Changed"
        AppendOutput "Output","PC"
      End Sub

       

      Sub Application_ProjectChanged()
        MsgBox "Project Changed"
        AppendOutput "Output","PC"
      End Sub