![]() |
Is there a maximum number of Add-ins allowed? - strange Excel behaviour
Hi all,
A strange thing happens to me when trying to add a new Add-in to the list of available Add-ins in Excel XP: Currently there are 15 Addins listed in my Addin dialog screen (Tool/Add-ins...). Using COM Automation (via Pascal scripting in Inno Setup), I am trying to add one more to the list. The code is similar to this (but slightly different due to the Pascal script requirements). Dim oXL as Object, oAddin as Object Set oXL = CreateObject("Excel.Application") oXL.Workbooks.Add Set oAddin = oXL.Addins.Add(..\"MyAddin.xla",True) oAddin.Installed = True oXL.Quit This works fine. However, my Add-in should only be activated when the user uses a specific template workbook. So I don't want to have it installed as a default, just registered with Excel so it is available in the Add-ins dialog window. Also this works fine. So what is the problem you might think? It turns out that if the Add-in dialog is already filled with Add-ins (i.e. 15 or more), that the newly added Add-in can not be found in the list anymore! If I get rid of just one Addin from the available list of Add-ins, than there is no problem, but 15 Add-ins just seems to be the critical number here. A work-around is to leave the Add-in installed using code similar as above and have code in the template file that ensures that the Add-in is uninstalled when that template file is closed. But I just wondered why this strange behaviour occurs. Is it true that there is a maximum number of Add-ins that can be handled normally. I am sure somebody must have seen this before, but searching the archives did not bring me any further. Anybody? Best regards, Bennie Douma Excel XP / Windows XP Home Edition *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
Is there a maximum number of Add-ins allowed? - strange Excel behaviour
I doubt this. I think it may be related to the fact that the NAME of the addin has a conflict.. and the addin collection cannot create a unique 'key for it's index. If the addin's Title property is EMPTY the filename will be used as a key to the addins collection. If the Title is not empty the Title will be used. If the Title is not unique... the conflict may arise. I've just tested with a small .vbs which added 100 addins without problems. -- keepITcool | www.XLsupport.com | keepITcool chello nl | amsterdam Bennie Douma wrote : Set oXL = CreateObject("Excel.Application") oXL.Workbooks.Add Set oAddin = oXL.Addins.Add(..\"MyAddin.xla",True) oAddin.Installed = True oXL.Quit |
All times are GMT +1. The time now is 02:52 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com