From: CB on
Hi Gary,

Thank you for your offer of assistance (Appreciated!).

I had a feeling there was no simple answer but thought I'd ask.

After I uninstall the Addin I'll write some nested IF lines (for
different Office versions) to remove from the Add In Manager to complete
the removal.

I very much apprciate your offer of help.
Kind Regards,
Charlie.


GS wrote:
> 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: GS on
CB was thinking very hard :
> Hi Gary,
>
> Thank you for your offer of assistance (Appreciated!).
>
> I had a feeling there was no simple answer but thought I'd ask.
>
> After I uninstall the Addin I'll write some nested IF lines (for different
> Office versions) to remove from the Add In Manager to complete the removal.
>
> I very much apprciate your offer of help.
> Kind Regards,
> Charlie.
>
Like I said, it's complex and so not going to be as easy as writing
some nested IF constructs. To access the Registry keys you need to edit
requires using several RegistryAPI functions and their relative
constants, and you must ensure you pass their parameters correctly.
There are no built-in VB/VBA functions to do this (i.e.: DeleteSetting
will not work because it won't access the required part of the
Registry).

I use my solution for clients who want an easy way to remove my XLA
addins when no longer used/wanted or the licenses have expired. XLA
type addins do not provide a way of 'auto-uninstalling' via Add/Remove
Programs as do COMAddins. I got this utility from Rob Bovey (it's
author), who made it for his own use. It's specifically designed to
only require the addin's filename, then compile it to a VB6.EXE and
send off to the client. Because he gave it to me for my own personal
use, I think you will understand why I won't give out the code. (The
original VBP contains 4 modules) I also use it as a development tool
for retesting initial startup behavior for XLA type projects. (I keep
refering to anything that is package in a workbook as a 'XLA type'
project, whether or not the "xla" file extension is used)

Peter T gave you one of the keys you need to edit. There is also the
"Options" key to check because if the addin was not uninstalled or
unchecked in the Addin Manager dialog it's entry will be found there. I
realize Peter suggests uninstalling/unchecking it first so you only
have to edit the one Registry key, but you may find it less work and
more convenient to do it all in one place since you MUST edit the
Registry anyway. The utility I use edits both keys and so requires
doing nothing on the part of my clients.

Best of luck in your effort!
Garry


From: CB on
Many Thanks to Dave, Gary & Peter!
- I appreciate your time given to replying to my question.
Kind Regards from Australia!
Charlie.B

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
First  |  Prev  | 
Pages: 1 2
Prev: WordMerge
Next: Can I stop the footer from indenting?