Project_BeforeClose Event

Z

zip

Hello again,

I have applied both Project_Open and Project_BeforeClose events to my
project file and they work beautifully if you close the file via the File >
Close method or the small secondary "x" in the top right hand corner. My only
problem is if the user decides to use the larger white and red cross to
cancel the whole program. The project file saves but the Project_BeforeClose
code does not run. How can I ensure that this code runs no matter which way
the user closes the program?

There is always something! Any help would be much appreciated :)
 
J

Jack Dahlgren

Hmmm...
Further proof that MS Project events just aren't as robust as they should
be.
What is it you are trying to do? Perhaps it can be done at a different time
(like the next time the file opens)
 
Z

zip

Yes maybe...

My Project_Open runs a macro that puts a custom toolbar into Global.mpt
through the organiser so that the toolbar can be viewed over a network.

Project_BeforeClose moves the same toolbar from Global.mpt back to the
Project file and deletes the one in Global so that the toolbar doesn't stay
there when the user opens other project files.

I dont really know how I can control this any other way...
 
G

Gérard Ducouret

Zip,

May be could you try to use also the BeforeSave event...

Gérard Ducouret
 
J

Jack Dahlgren

Maybe have an open event delete the toolbar from Global.mpt. Put that in the
global file so it runs when you start up project. It will catch the
occasions when the user quits Project in the way you describe or when
project crashes. The Project_Close event should work for the "normal" case.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top