ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Unload all addins in VBA (https://www.excelbanter.com/excel-programming/321752-unload-all-addins-vba.html)

arne

Unload all addins in VBA
 
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




Rob van Gelder[_4_]

Unload all addins in VBA
 
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

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"arne" wrote in message
...
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






arne

Unload all addins in VBA
 
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)

"Rob van Gelder" skrev i melding
...
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

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"arne" wrote in message
...
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








Bob Phillips[_6_]

Unload all addins in VBA
 
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)


"arne" wrote in message
...
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






Markus Scheible[_2_]

Unload all addins in VBA
 
Hi Arne,

why not use

Unload Application.AddIns

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

Best regards

Markus

-----Original Message-----
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



.


arne

Unload all addins in VBA
 
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

Unload all addins in VBA
 
It does not work; I get runtime error 361..
arne
'''''

"Markus Scheible" skrev i melding
...
Hi Arne,

why not use

Unload Application.AddIns

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

Best regards

Markus

-----Original Message-----
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



.




keepITcool

Unload all addins in VBA
 
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 :

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


Rob van Gelder[_4_]

Unload all addins in VBA
 
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


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"arne" wrote in message
...
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)

"Rob van Gelder" skrev i melding
...
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

--
Rob van Gelder - http://www.vangelder.co.nz/excel


"arne" wrote in message
...
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











All times are GMT +1. The time now is 12:20 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com