ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Help with Uninstall Event (https://www.excelbanter.com/excel-programming/295445-help-uninstall-event.html)

Clinton[_2_]

Help with Uninstall Event
 
Hi

Some thing bizarre is happening! I have an add-in which when uninstalled
through the uninstall event removes a custom toolbar attached to it. Im
using Inno Setup to uninstall this add-in through Automation.

This works perfectly on my windows 2000 machine, but on my windows xp
machine the add-in is removed from the add-in list, but the toolbar isn't.

Both machines are running Excel 2000.

Hopefully a genius out there can help out this non-genius!

Cheers

Clinton



Bob Phillips[_6_]

Help with Uninstall Event
 
Showing the code might help.

What is Inno Setup?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Clinton" wrote in message
...
Hi

Some thing bizarre is happening! I have an add-in which when uninstalled
through the uninstall event removes a custom toolbar attached to it. Im
using Inno Setup to uninstall this add-in through Automation.

This works perfectly on my windows 2000 machine, but on my windows xp
machine the add-in is removed from the add-in list, but the toolbar isn't.

Both machines are running Excel 2000.

Hopefully a genius out there can help out this non-genius!

Cheers

Clinton





Clinton[_2_]

Help with Uninstall Event
 
Well, inno setup is actually irrelevant. Here is the VB code that does the
uninstallation. I just put the name of the add-in as listed in Tools|Addins
as the command line parameter(s)

Dim oXL As Object, oAddin As Object
Dim i As Integer

Set oXL = CreateObject("Excel.Application")
Call GetCommandLine

For i = 1 To UBound(argarray)

'if inverted commas are included in commandline, would cause error
'as add-in file name would not exist. this function removes the inverted
commas

If Len(argarray(i)) = 0 Then
MsgBox "No Command Line arguments - cannot automatically remove
Excel Add-in(s).", vbCritical, "No Command Line Arguments"
End
End If

argarray(i) = ReplaceLetter(argarray(i), Chr(34), "")

'unticks add-in in Tools|Add-ins and runs the uninstall event!
'note the trim. this is to cater for parameters separated by a comma,
and also a comma and space
oXL.addins(Trim(argarray(i))).Installed = False

'once uninstalled, can delete Add-in. However, this doesn't remove the
deleted add-in from
'Tools | Add-ins.
Kill oXL.addins(Trim(argarray(i))).fullname

Next i

oXL.Quit
Set oXL = Nothing

On Error GoTo 0

End Sub
"Bob Phillips" wrote in message
...
Showing the code might help.

What is Inno Setup?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Clinton" wrote in message
...
Hi

Some thing bizarre is happening! I have an add-in which when uninstalled
through the uninstall event removes a custom toolbar attached to it. Im
using Inno Setup to uninstall this add-in through Automation.

This works perfectly on my windows 2000 machine, but on my windows xp
machine the add-in is removed from the add-in list, but the toolbar

isn't.

Both machines are running Excel 2000.

Hopefully a genius out there can help out this non-genius!

Cheers

Clinton







Bob Phillips[_6_]

Help with Uninstall Event
 
Thought so, but just interested.

Can't run it as you don't give us the GetCommandLine sub.

Are you not explicitly deleting the toolbar?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Clinton" wrote in message
...
Well, inno setup is actually irrelevant. Here is the VB code that does the
uninstallation. I just put the name of the add-in as listed in

Tools|Addins
as the command line parameter(s)

Dim oXL As Object, oAddin As Object
Dim i As Integer

Set oXL = CreateObject("Excel.Application")
Call GetCommandLine

For i = 1 To UBound(argarray)

'if inverted commas are included in commandline, would cause error
'as add-in file name would not exist. this function removes the

inverted
commas

If Len(argarray(i)) = 0 Then
MsgBox "No Command Line arguments - cannot automatically remove
Excel Add-in(s).", vbCritical, "No Command Line Arguments"
End
End If

argarray(i) = ReplaceLetter(argarray(i), Chr(34), "")

'unticks add-in in Tools|Add-ins and runs the uninstall event!
'note the trim. this is to cater for parameters separated by a comma,
and also a comma and space
oXL.addins(Trim(argarray(i))).Installed = False

'once uninstalled, can delete Add-in. However, this doesn't remove the
deleted add-in from
'Tools | Add-ins.
Kill oXL.addins(Trim(argarray(i))).fullname

Next i

oXL.Quit
Set oXL = Nothing

On Error GoTo 0

End Sub
"Bob Phillips" wrote in message
...
Showing the code might help.

What is Inno Setup?

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Clinton" wrote in message
...
Hi

Some thing bizarre is happening! I have an add-in which when

uninstalled
through the uninstall event removes a custom toolbar attached to it.

Im
using Inno Setup to uninstall this add-in through Automation.

This works perfectly on my windows 2000 machine, but on my windows xp
machine the add-in is removed from the add-in list, but the toolbar

isn't.

Both machines are running Excel 2000.

Hopefully a genius out there can help out this non-genius!

Cheers

Clinton










All times are GMT +1. The time now is 12:38 PM.

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