Forum Discussion
Gilgamesh1964
Aug 15, 2022Brass Contributor
Is there an alternative to Auto_Open for when MS Project lauches.
Hello, I want to have a macro in my global.mpt that will activate when MS Project launches regardless of the schedule file. I'm only looking for it to happen that once (to modify the xml in some cu...
Gilgamesh1964
Aug 24, 2022Brass Contributor
Hello,
Unfortunately there has been no response so I'm now assuming that having a macro run when launching MS Project is not possible.
I was hoping for something along the lines of AutoExec is MS Word.
However I will still thank those who took the time to consider this query.
Unfortunately there has been no response so I'm now assuming that having a macro run when launching MS Project is not possible.
I was hoping for something along the lines of AutoExec is MS Word.
However I will still thank those who took the time to consider this query.
Aug 24, 2022
Gilgamesh1964 --
I want to apologize for not responding to your question sooner. I was hoping that one of our VBA gurus would answer your question, but that did not happen.
So, allow me to take a stab at answering your question. First of all, you definitely want to use the Auto_Open macro to run the VBA code whenever Microsoft Project is launched. I believe you will want to add this macro to the Enterprise Global file so that it runs automatically for every user each time they launch Microsoft Project and connect to Project Online.
When the code runs, however, you need to test Microsoft Project to determine if the macro code has already run and has modified the ribbons. My recommendation for this test would be to create a custom enterprise Project field named something like Ribbon_Updated. Make the field a custom Flag field and set the default value to No for this field.
Then in your Auto_Open macro, perform a test on the Ribbon_Updated field. If the value is No, then the rest of the macro code should run. If the value is Yes, the macro should exit after the test and not run any further.
Don't know if this is any help to you, but at least I tried. Let us know how things go.
I want to apologize for not responding to your question sooner. I was hoping that one of our VBA gurus would answer your question, but that did not happen.
So, allow me to take a stab at answering your question. First of all, you definitely want to use the Auto_Open macro to run the VBA code whenever Microsoft Project is launched. I believe you will want to add this macro to the Enterprise Global file so that it runs automatically for every user each time they launch Microsoft Project and connect to Project Online.
When the code runs, however, you need to test Microsoft Project to determine if the macro code has already run and has modified the ribbons. My recommendation for this test would be to create a custom enterprise Project field named something like Ribbon_Updated. Make the field a custom Flag field and set the default value to No for this field.
Then in your Auto_Open macro, perform a test on the Ribbon_Updated field. If the value is No, then the rest of the macro code should run. If the value is Yes, the macro should exit after the test and not run any further.
Don't know if this is any help to you, but at least I tried. Let us know how things go.