Excel - Macro to open and close addins

Asked By Steph
29-Jan-10 03:40 AM
Can anyone provide an example of a macro that loads and / or unloads an
add-in file when run?  For example, if it loads the add-in I would want to
see the file appear in the add-ins available dialog box.  When it unloads the
add-in, it would then be removed from the dialog box.  Thanks for your help.
--
Steph
AddIns
(1)
Application.AddIns
(1)
Macro
(1)
VBA
(1)
AddinUnInstall
(1)
AddinInstall
(1)
TrySub
(1)
Toolpak
(1)
  Jacob Skaria replied to Steph
29-Jan-10 04:12 AM
Try

Sub AddinInstall()
If Not Application.AddIns("Analysis Toolpak - VBA").Installed Then _
Application.AddIns("Analysis Toolpak - VBA").Installed = True
End Sub

Sub AddinUnInstall()
If Application.AddIns("Analysis Toolpak - VBA").Installed Then _
Application.AddIns("Analysis Toolpak - VBA").Installed = False
End Sub


--
Jacob
  Steph replied to Jacob Skaria
29-Jan-10 06:07 PM
Thank you!!
--
Steph
Create New Account
help
to 'Solver' and click 'OK' Thanks! - - Robert Excel Programming Discussions WdnRpIJJaV1pfanZ2dnUVZ (1) Microsoft Excel (1) AddIns (1) Office (1) Excel (1) Application.AddIns (1) Workbook (1) Macro (1) If you are writing VBA code to use Solver, simply set a reference to Solver routines, then include this line of code somewhere at the top of your code: AddIns("Solver Add-in").Installed = True - - Regards, Bill Renaud currently Thanks Bill. Yeah, I figured out Solver installed correctly the 2nd time after temporarily uninstalling it (and before running the Auto_open macro). Why wouldn't Solver simply go back to the same state that it had when you checked Application.AddIns("Solver Add-In").Installed the 1st time? - - Regards, Bill Renaud Because it doesn't. <g
Automatically load solver reference library Excel Greetings. I have a macro that runs solver. Every time I switch between my work computer (Excel 2003) and my depending on which version of Excel I am using? Thank you. Greg Excel Programming Discussions AddIns (1) Excel 2007 (1) Excel 2003 (1) Error (1) Application.AddIns (1) Workbook (1) Macro (1) AddSolverRef (1) I had a similar problem: http: / / groups.google.com / group / microsoft.public a38d859c231fb626 / bea27fdcc6872056?q = solver - - Gary''s Student - gsnu200905 Well, I was hopeful when I added " Application.AddIns("Solver Add-in").Installed = False Application.AddIns("Solver Add-in").Installed = True", because it went through the whole routine without throwing
xls").Path Set xl = CreateObject("Excel.Application") On Error Resume Next For Each ai In Application.AddIns If ai.Installed Then xl.Workbooks.Open(ai.FullName).RunAutoMacros 1 End If Next xl xl.Run StartSub End If End If Set xl = Nothing End Sub Excel Programming Discussions AddIns (1) Workbooks (1) Error (1) Excel (1) Application.AddIns (1) Application.OnTime (1) Macro (1) VB (1) Not sure I quite follow but I guess the open event of one of those addins (you are opening all the installed ones) goes on to do a lot of stuff s the case, in the relevant open event call that long code with an OnTime macro In passing, xl.Workbooks.Open(ai.FullName).RunAutoMacros 1 Be careful doing that with all
Affecter_bouton_dans_la_barre_d'outils_pour_une_macro_complémentaire? Excel Bonjour, Comment affecter un bouton dans la barre d'outils pour une macro compl = E9mentaire? Pour une macro standard pas de probl = E8me ; l'affectation se fait sur le classeur ouvert, mais sur une macro compl = E9mentaire lorsque je veux affecter. . .rien n'apparait! Merci Excel - French Discussions AddIns (1) Excel 2010 (1) Excel 2007 (1) Excel 2003 (1) Windows 7 (1) Excel (1) Module (1) Macro (1) Bonjour, Un petit exemple : A ) Ex?cuter une macro "test" situ?e dans un module standard dans le fichier de macros compl?mentaires "MichD xla Sub Bonjour() Application.Run "michd.xla!Test" End Sub B ) Si ta macro dans un module feuille du fichier contenant les macros compl?mentaires tu dois ajouter le Application.Run "michd.xla!Feuil1.Test" End Sub C ) Si le nom de ton fichier macro compl?mentaire contient un espace, On doit entourer le nom du fichier par des guillemets