Hi everyone,
I've created an automation AddIn for Excel. It is not a COMAddIn (I don't implements IDTExtensibility2). It is not an XLA or a XLL neither.
It is just a COM component which is loaded in the AddIn dialog box of Excel via its COM id. You can find it in the registry under the key HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Options, with an OPEN entry set to value /A "WdLayer.XLLMAP.1".
If you need more information on Automation addin, please have a look at: http://support.microsoft.com/kb/291392
But when I call a method called "IsAddinStartupComplete" from XLLMAP, my COM component, I encounter a synchronization issue depending on the list of other addins loaded on excel startup. If no other addin are loaded, my call succeeds, otherwise when I launch the call it might fails. If I put a break point in the VBA code below, and wait a little bit, it succeeds. So basically, I need to know when I can be sure that my addin will be usable because I get the Excel application COM instance way before everything is loaded and I'm not able to know when it will be ok to use need. I'm simply unable to synchronize myself with my Excel automation instance. Would someone have an idea of how to do it ?
Sub Test()
Dim excel As excel.Application
Set excel = CreateObject("excel.Application")
excel.Visible = True
Dim ourAddin As excel.AddIn
On Error Resume Next
Set ourAddin = excel.AddIns("XLLMAP Class")
Debug.Print IIf(ourAddin.Installed, "Installed", "NotInstalled")
bool = excel.Run("IsAddinStartupComplete")
Debug.Print IIf(bool, "Success", "Failure")
excel.Quit
End Sub
Bookmarks