01-28-2012, 07:38 PM
In next QM ExcelSheet will have function LoadAddins. Excel does not load addins when started by macro.
Now you can test it.
Member function ExcelSheet.LoadAddins_Test
Now you can test it.
Member function ExcelSheet.LoadAddins_Test
function [flags] ;;flags: 1 run auto open macros
;Loads installed Excel addins (.xla, .xll).
;REMARKS
;When Excel started by Init, it does not load addins. If need, call this function after Init.
;Added in: QM 2.3.3.
Excel.Application a=ws.Application
Excel.AddIn x
foreach x a.AddIns
,_s=""
,if(!x.Installed) continue
,_s=x.FullName
,int failed=0
,if _s.endi(".xll")
,,failed=!a.RegisterXLL(_s)
,else
,,Excel.Workbook b=a.Workbooks.Open(_s) ;;xla
,,if(flags&1) b.RunAutoMacros(Excel.xlAutoOpen); err
,
,err+ failed=1
,if(failed) out "Failed to load %s" _s
;Excel.COMAddIns=a.COMAddIns ;;should load too?