ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Uninstall Excel Addin (https://www.excelbanter.com/excel-programming/328582-uninstall-excel-addin.html)

Derrick[_3_]

Uninstall Excel Addin
 
Hello all;

I have a question about the proper way to uninstall my Excel Addin (.xla
file), developed with VSTO 2003.

My installer will remove the proper files and directorys, and I have a
custom command-line app which adjusts the .NET Configuration Security Policy
correctly (using caspol.exe).

What I want to know is how to keep Excel from trying to load the addin after
it has been uninstalled? Do I have to adjust the registry entry
"HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\ Excel\Options\OPEN", or is
there an easier/better way?



Gary's Student

Uninstall Excel Addin
 
Have you tried Tools - Addins.. - uncheck the box ??
--
Gary's Student


"Derrick" wrote:

Hello all;

I have a question about the proper way to uninstall my Excel Addin (.xla
file), developed with VSTO 2003.

My installer will remove the proper files and directorys, and I have a
custom command-line app which adjusts the .NET Configuration Security Policy
correctly (using caspol.exe).

What I want to know is how to keep Excel from trying to load the addin after
it has been uninstalled? Do I have to adjust the registry entry
"HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\ Excel\Options\OPEN", or is
there an easier/better way?




Derrick[_3_]

Uninstall Excel Addin
 
Sorry - should've been more clear. I need to do this programmatically,
during the uninstall process of my addin.

Also, I just noticed that the registry key method is not going to work
reliably.

Thanks,

Derrick

"Gary's Student" wrote in message
...
Have you tried Tools - Addins.. - uncheck the box ??
--
Gary's Student


"Derrick" wrote:

Hello all;

I have a question about the proper way to uninstall my Excel Addin (.xla
file), developed with VSTO 2003.

My installer will remove the proper files and directorys, and I have a
custom command-line app which adjusts the .NET Configuration Security
Policy
correctly (using caspol.exe).

What I want to know is how to keep Excel from trying to load the addin
after
it has been uninstalled? Do I have to adjust the registry entry
"HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\ Excel\Options\OPEN", or
is
there an easier/better way?






Michel Pierron

Uninstall Excel Addin
 
Hi Derrick,

It is not easy. The only way that I found to make that is to carry out this
operation by a sending senkeys sequence in Excel. You can create an Excel
file and include the following procedu

Sub UninstallAddIn()
Const xlaPath = "C:\"
Const xlaFileName = "YourAddin.xla"
Dim I As Integer, Ok As Boolean
DoEvents
With AddIns
For I = 1 To .Count
If .Item(I).Name = xlaFileName Then
..Item(I).Installed = False
Ok = True: Exit For
End If
Next I
If Not Ok Then Exit Sub
On Error Resume Next
Kill xlaPath & xlaFileName
SendKeys "{HOME}"
For I = 1 To .Count
If .Item(I).Name = xlaFileName Then Exit For
SendKeys "{DOWN}"
Next I
SendKeys "~{ESC}"
Application.CommandBars.FindControl(ID:=943).Execu te
End With
End Sub

And after, you can run this procedure with a vbs file:

Const xlFileName = "Full path of your Excel file created"
Dim objXl, Fso
Set objXL = WScript.CreateObject("Excel.Application")
objXL.Visible = TRUE ' Or False
objXL.WorkBooks.Open xlFileName
objXL.Run "UninstallAddIn"
objXL.Quit
Set objXL = Nothing
Set Fso = CreateObject("Scripting.FileSystemObject")
On Error Resume Next
Fso.DeleteFile xlFileName
Set Fso = Nothing
WScript.Quit

It must be possible to include the totality of the code in your desinstaller
if the language used includes the control flow instruction (DoEvents), which
is not the case of vbscript.

MP

"Derrick" a écrit dans le message de news:
...
Hello all;

I have a question about the proper way to uninstall my Excel Addin (.xla
file), developed with VSTO 2003.

My installer will remove the proper files and directorys, and I have a
custom command-line app which adjusts the .NET Configuration Security

Policy
correctly (using caspol.exe).

What I want to know is how to keep Excel from trying to load the addin

after
it has been uninstalled? Do I have to adjust the registry entry
"HKEY_CURRENT_USER\Software\Microsoft\Office\11.0\ Excel\Options\OPEN", or

is
there an easier/better way?






All times are GMT +1. The time now is 01:30 PM.

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