Unload all addins in VBA

  • Thread starter Thread starter arne
  • Start date Start date
A

arne

Is there a way to unload all addins every time you open Excel 2000? (The
users may use addins I do not know the name of , therfore I can not say
which one to unload.)

Like For Each AddIns
If AddIns is loaded then unload

arne
 
I'm reading that you dont want to uninstall addins, just temporarily close
them for this Excel session?

Sub test()
Dim wkb As Workbook

For Each wkb In Workbooks
If Not wkb Is ThisWorkbook Then wkb.Close
Next
End Sub
 
Your solution just close active workbook. I need to
unload addins in a way that when the user starts using Excel she starts with
no addins activated, but can choose by herself (or by buildt in code) which
one to load.
The addins (*.xla files must not be uninstalled)
 
Arne,

This will uninstall all addins, but I don't recommend it, you might be
uninstalling things that the workbooks depend upon on.

For Each add_in In Application.AddIns
If add_in.Installed Then add_in.Installed = False
Next addin

The add-ins will still be in the add-ins list, and can be re-installed.

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Hi Arne,

why not use

Unload Application.AddIns

? because the addins collection stands for every possible
addin, it should work...

Best regards

Markus
 
This works! Thanks BOB.

Working code--


Sub Auto_open()
'removeall_addins' Thanks to Bob Phillips microsoft.public.excel.programming
'you can still install the addins, the addins do not
'leave your PC!
For Each Add_In In Application.AddIns
If Add_In.Installed Then Add_In.Installed = False
Next Add_In

End Sub

Sub addall_addins()
' install all the addins! But you do not need to do that......
For Each Add_In In Application.AddIns
If Add_In.Installed = False Then Add_In.Installed = True
Next Add_In

End Sub
 
Arne...

You're not heeding Bob's warning.
Uninstalling ALL addins may not be appreciated by your users
(thay may expect to have "Analysis Toolpak" loaded at all times)

The second one however is FAR worse...
I have over 60 addins listed in my addins list.
I would NOT be happy if your little procedure would start loading them
all.. <G>

If you want to temporarily unload addins you MUST store the
previously loaded addins in a module level collection.

Then when your procedure is done you should restore THOSE addins





--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


arne wrote :
 
Sub test()
Dim wkb As Workbook

For Each wkb In Workbooks
If Not wkb Is ThisWorkbook Then
If Not wkb.IsAddin Then wkb.Close
End If
Next
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top