Help with Uninstall Event

  • Thread starter Thread starter Clinton
  • Start date Start date
C

Clinton

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
 
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)
 
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
 
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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top