mjohnson

Does Application_ProjectChanged() Work?

Discussion created by mjohnson on Jul 31, 2013
Latest reply on Jul 31, 2013 by 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

Outcomes