View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Maury Markowitz[_2_] Maury Markowitz[_2_] is offline
external usenet poster
 
Posts: 119
Default When do AddIns load?

Due to the way that Excel locks XLA's when loaded from the network,
we're trying to lazy-load them when needed. We have a single very
small XLA that's put into the AddIns, with a single exposed sub that
you can call to load other XLAs on demand.

This seems to work well when you do everything inside Excel, but I
notice it doesn't work if you call Excel from another program, in this
case Access. When you open Excel using CreateObject, there's no AddIns
at all. Is there something I need to do to trigger Excel to load them
up?

Here's the code, it fails on the application.run...

On Error Resume Next
bStarted = False
Set oExcelApp = GetObject(, "Excel.Application")
If Err < 0 Then
' excel wasn't running, start it from code
Set oExcelApp = CreateObject("Excel.Application")
bStarted = True
End If
On Error GoTo 0
oExcelApp.Visible = True

' make sure that HPLCreate is open and up to date
ret = oExcelApp.Application.Run("ModuleLoader.xla!
LoadAndUpdateAllModulesInXLA", "HPLCreate")