Office VBA application add-in load / unload order

I've been doing some testing to try to ascertain what algorithm the Microsoft application add-in loader uses to determine the load order of VBA add-ins. To test it, I created two very simple PowerPoint ppam addins with two procedures in each.

add-inAAA.ppam
Option Explicit

Sub Auto_Open()
  MsgBox "AAA is loading"
End Sub

Sub Auto_Close()
  MsgBox "AAA is unloading"
End Sub

Open in new window

add-inZZZ.ppam
Option Explicit

Sub Auto_Open()
  MsgBox "ZZZ is loading"
End Sub

Sub Auto_Close()
  MsgBox "ZZZ is unloading"
End Sub

Open in new window

When I load these and restart PowerPoint, I see the AAA loading message followed by the ZZZ loading message and then when I quit PowerPoint, I see the corresponding unloading messages, AAA first followed by ZZZ.

Given that there is only one occurrence of the add-ins in the registry, for example:
HKEY_USERS\S-1-5-21-1654165938-2830638315-1088483835-1001\Software\Microsoft\Office\15.0\PowerPoint\AddIns\Add-In AAA
AutoLoad = 1
Path = Add-InAAA.ppam

Open in new window

there appears to be no record of the order in which the add-ins were installed so is it as simple as an alphabetic order as indicated be the above? Is this a reliable detection method?

Finally, I guess the reader(s) will ask "why do you care?". The answer is that I want add-in B to be able to install updates to add-in A but this can only be done when add-in A is not loaded and locked by the file system.
LVL 15
Jamie GarrochSenior Technical Consultant at BrightCarbonAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Alexei KuznetsovMicrosoft Outlook MVPCommented:
No reliable method exist to detect this order. You need to use other synchronization methods, like checking locks by either using external files and/or Windows synchronization primitives like mutexes. Or re-think your add-in update logic.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jamie GarrochSenior Technical Consultant at BrightCarbonAuthor Commented:
Thanks Alexei. Those are good pointers and I do already manage mutexes so that is a good pointer in a different direction. I'll hang on a bit longer to see if there are any other contributors before accepting the answer.
Martin LissOlder than dirtCommented:
I've requested that this question be closed as follows:

Accepted answer: 500 points for thims's comment #a41060486

for the following reason:

This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Outlook

From novice to tech pro — start learning today.