Forum Discussion
Is there an alternative to Auto_Open for when MS Project lauches.
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, 2022Gilgamesh1964 --
After posting my first response, I had another idea for you. Why don't you create a new blank project named something like Update Ribbons? In that project file, create a Project_Open macro that contains the VBA code for updating the ribbons. Send this Microsoft Project file to each of your PMs and instruct them to allow Microsoft Project to run macros in the project. After the macro runs and updates the ribbons, the user could close and discard the project.
That would be a "one and done" approach, but of course, it assumes you will not need to update the ribbons with any changes after the initial round of updating. Just an additional thought for you. Hope this helps.- Gilgamesh1964Aug 25, 2022Brass ContributorThank you for responding.
Unfortunately we only use Project Desktop and don't have access to Project Online or Server so enterprise options won't work for us. I did put Auto_Open into the local global.mpt file but it didn't run when launching project.
I do have a separate file with a macro that installs the ribbons so that part is covered.
But MS Project removes some of my ribbon formatting between sessions, so I thought if there was something that runs are startup I might be able to reinstate the formatting each session (testing would be required to see if it would work). Asking the PMs to run this file once every time they start Project probably won't fly, so we may need to live with the lost formatting. 😞- John-projectAug 25, 2022Silver Contributor
I confess, I did read your post when it first appeared. I didn't respond because you asked if there was anything besides the Auto_Open Even and wasn't aware of anything but then my range of knowledge is limited to VBA. I probably should have responded by saying there might be an API that could do what you want but you'd have to do some research for that.
I do recall a previous post on this forum that is related to what you are trying to do. I'm not sure if it will help but you could give it a read.
If I may ask, can you show us the code you have that installs the ribbon? And which formatting is getting whacked?
One more thought popped into my mind after posting this. Years ago when I was in a corporate environment I customized the Project Global to include a series of macros (via custom icons). I hoped corporate would allow us to instill that customization into what was then the "base Global" used by all Project users but they didn't buy it so I ended up distributing the custom Global to all Project users in our group. This is along the same line that Dale proposed in his updated suggestion. As he said, just a thought.
John
- Aug 24, 2022Gilgamesh1964 --
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.