vba - Addin to install other addins on installation won't open them -


i wrote addin, adds other addins on installation, because deploying 1 addin easier deploying whole bunch of addins.

problem: after end sub of workbook_addininstall() of bootloader-addin, added/installed addin dissapear vbe, , aren't installed anymore. still added addins-menu.

question: can install every addin hand on every pc because ain't big number, still bugs me can't seem find faulty line. i'd appreciate every idea comes mind me solve problem.

bootloader addin:

private sub workbook_addininstall()     const aicount integer = 2     dim ai      addin     dim aitmp   addin      dim       integer     dim aipath  string      dim aitobeinstalled(1 aicount) string     dim aiinstalled(1 aicount)     boolean      aitobeinstalled(1) = "addin1.xla"     aitobeinstalled(2) = "addin2.xla"      'addin added?     each ai in addins         = 1 aicount             if ai.name = aitobeinstalled(i)                 set aitmp = ai                 aitmp.installed = true                 aiinstalled(i) = true                 exit             end if         next     next ai      'add not added addins     = 1 aicount         if not aiinstalled(i)             aipath = getdrivepath(volname:="somevolname", excludedrives:="d") & _                                 "hidden\" & aitobeinstalled(i)             set ai = addins.add(aipath, false)             ai.installed = true         end if     next      set ai = nothing     set aitmp = nothing end sub ' after "end sub" addins still added not installed. 

something interesting after installation of bootloader if run sub per f5, sub adds addins fine. , behaves you'd expect to.

edit: there no crucial things called on workbook_addininstall of addins being installed, changes menu. seeing that, confuses me. behaves if addins aren't associated application won't stay.

conclusion: far can go, if have ideas please let me know. working on workaround i'd want why doesn't work.

you need install add-in via vb editor current workbook project. .install() method register new guid in registry (as com object library) doesn't persist workbook reference..

'//start code snippet   '--!!-->   add reference workbook (on each computer).      '-->    if reference not registered (will/should) take      '-->    care of you..  application.vbe.activevbproject.references.addfromfile :your_file_path_here   '//end code snippet  

obviously, replace :your_file_path_here path of addin location... let me know if helps. have few more tricks if doesn't. thanks, brian.


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -