From: CB on
Hello,

The sample code I found below uninstalls an Excel add-in but leaves it
in the list of available Add-ins.

Im looking for a script to "completely" remove the Excel addin (tidy is
nice!).

I need to do this across a range of users with Office 2003 & 2007 so I
was wanting to reference Excel objects rather than Registry Keys which
vary depending on the Office Version.

Does anyone know if there is code to "completely" remove an Add-in?
Kind Regards
Charlie.B

Dim oXL
Dim crAddin
on error resume next
Set oXL = CreateObject("Excel.Application")
for i = 1 to oXL.Addins.Count
Set crAddin = oXL.Addins.item(i)
If crAddin.Name = "xpaddin.xla" then
crAddin.Installed = False
End If
Next
oXL.Quit
Set oXL = Nothing
From: ozgrid.com on
Uncheck the add-in from the add-ins dialog, move or delete the add-in from
its folder. Go back to Excel add-ins and check the add-in and say YES to
removing the add-in from the list.



--
Regards
Dave Hawley
www.ozgrid.com
"CB" <cbcb(a)hotmail.com.au> wrote in message
news:4be5f990$0$32019$afc38c87(a)news.optusnet.com.au...
> Hello,
>
> The sample code I found below uninstalls an Excel add-in but leaves it in
> the list of available Add-ins.
>
> Im looking for a script to "completely" remove the Excel addin (tidy is
> nice!).
>
> I need to do this across a range of users with Office 2003 & 2007 so I was
> wanting to reference Excel objects rather than Registry Keys which vary
> depending on the Office Version.
>
> Does anyone know if there is code to "completely" remove an Add-in?
> Kind Regards
> Charlie.B
>
> Dim oXL
> Dim crAddin
> on error resume next
> Set oXL = CreateObject("Excel.Application")
> for i = 1 to oXL.Addins.Count
> Set crAddin = oXL.Addins.item(i)
> If crAddin.Name = "xpaddin.xla" then
> crAddin.Installed = False
> End If
> Next
> oXL.Quit
> Set oXL = Nothing

From: CB on
Thanks! Dave.
You're suggestions are correct but still requires a few simple user
steps to completley remove an Add-in from the Available Add-in's List.
I'm looking for a coded (scripted) way to do the full removal as the
code below only deactivates the Addin and then the user need to follow
the manaul steps.

All ideas welcome.
Charlie.B

ozgrid.com wrote:

> Uncheck the add-in from the add-ins dialog, move or delete the add-in
> from its folder. Go back to Excel add-ins and check the add-in and say
> YES to removing the add-in from the list.
>
>
>

CB wrote:
> Hello,
>
> The sample code I found below uninstalls an Excel add-in but leaves it
> in the list of available Add-ins.
>
> Im looking for a script to "completely" remove the Excel addin (tidy is
> nice!).
>
> I need to do this across a range of users with Office 2003 & 2007 so I
> was wanting to reference Excel objects rather than Registry Keys which
> vary depending on the Office Version.
>
> Does anyone know if there is code to "completely" remove an Add-in?
> Kind Regards
> Charlie.B
>
> Dim oXL
> Dim crAddin
> on error resume next
> Set oXL = CreateObject("Excel.Application")
> for i = 1 to oXL.Addins.Count
> Set crAddin = oXL.Addins.item(i)
> If crAddin.Name = "xpaddin.xla" then
> crAddin.Installed = False
> End If
> Next
> oXL.Quit
> Set oXL = Nothing
From: GS on
CB brought next idea :
> Hello,
>
> The sample code I found below uninstalls an Excel add-in but leaves it in the
> list of available Add-ins.
>
> Im looking for a script to "completely" remove the Excel addin (tidy is
> nice!).
>
> I need to do this across a range of users with Office 2003 & 2007 so I was
> wanting to reference Excel objects rather than Registry Keys which vary
> depending on the Office Version.
>
> Does anyone know if there is code to "completely" remove an Add-in?
> Kind Regards
> Charlie.B
>
> Dim oXL
> Dim crAddin
> on error resume next
> Set oXL = CreateObject("Excel.Application")
> for i = 1 to oXL.Addins.Count
> Set crAddin = oXL.Addins.item(i)
> If crAddin.Name = "xpaddin.xla" then
> crAddin.Installed = False
> End If
> Next
> oXL.Quit
> Set oXL = Nothing

This is a complex process, but can be done. You'll need to write code
to remove the addin entries in the Registry. There are two keys that
must be edited: 'Add-in Manager' and 'Options'. You'll also need
several declares and constants for using the necessary RegistryAPI
functions, and two separate procedures to remove the Registry entries.
These two procedures will be called from a Main() sub that first checks
the Registry for each version of Excel that may be in use, to determine
if the addin has an entry. This is necessary because each Excel version
has its own Registry key, and you must edit the correct key. Thus, you
may have to check several keys depending on the earliest version of
Excel the addin has been installed to.

If you're not up for messing around in the Registry, post the filename
of your addin and your email address if you want me to send you a
VB6.exe that will do this for you.

Garry


From: Peter T on
It depends where the addin is. If it's in one of the default addin folders
simply remove it (after uninstalling it if not already).
Application.UserLibraryPath and for backwards compatibility
..Application.LibraryPath

If it's not in a default folder it will no longer appear in the addin's
list, however it will still remain in the addins collection and in the
registry (as GS mentioned). First uninstall the addin, either manually or
programmatically. Close *all* instances of Excel. Delete the relevant entry
in this key -

HKEY_CURRENT_USER\Software\Microsoft\Office\X.0\Excel\Add-in Manager

where X is the Excel version, eg 11 for 2003

Regards,
Peter T


"CB" <cbcb(a)hotmail.com.au> wrote in message
news:4be5f990$0$32019$afc38c87(a)news.optusnet.com.au...
> Hello,
>
> The sample code I found below uninstalls an Excel add-in but leaves it in
> the list of available Add-ins.
>
> Im looking for a script to "completely" remove the Excel addin (tidy is
> nice!).
>
> I need to do this across a range of users with Office 2003 & 2007 so I was
> wanting to reference Excel objects rather than Registry Keys which vary
> depending on the Office Version.
>
> Does anyone know if there is code to "completely" remove an Add-in?
> Kind Regards
> Charlie.B
>
> Dim oXL
> Dim crAddin
> on error resume next
> Set oXL = CreateObject("Excel.Application")
> for i = 1 to oXL.Addins.Count
> Set crAddin = oXL.Addins.item(i)
> If crAddin.Name = "xpaddin.xla" then
> crAddin.Installed = False
> End If
> Next
> oXL.Quit
> Set oXL = Nothing


 |  Next  |  Last
Pages: 1 2
Prev: WordMerge
Next: Can I stop the footer from indenting?