Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 265
Default uninstall add in

Hi, I'm trying to figure out how to accomplish somehting:

I have an add-in and I would like it to chek the computer's name when
installed, if the computer's name does not match the default registered
computer's name (Leon1 in this case) then the add-in is uninstalled
(uninstall itself).
The code works fine until the AddIns("Periodical Table").Install=false is
called:


Private Sub Workbook_AddinInstall()
strComputer = "."
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery("Select * from
Win32_ComputerSystem")
With Workbooks("periodical Table.xla").Sheets(2)
For Each objComputer In colSettings
If LCase(objComputer.Name) < "leon1" Then
MsgBox "The program has detected that you coppied the add-in, please contact
your program provider", vbOKOnly, "Illegal copy detection"
AddIns("Periodical Table").Install=false
Else: GoTo nx
End If
Next
End With
nx:
End Sub


It does not appear any error, the msgbox works well but it nevers uninstall
the add-in.

TIA


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,290
Default uninstall add in

This part stuck out...
AddIns("Periodical Table").Install=false

..Install should be .Installed
--
Jim Cone
San Francisco, USA
http://www.realezsites.com/bus/primitivesoftware
(Excel Add-ins / Excel Programming)



"filo666"
wrote in message
Hi, I'm trying to figure out how to accomplish somehting:
I have an add-in and I would like it to chek the computer's name when
installed, if the computer's name does not match the default registered
computer's name (Leon1 in this case) then the add-in is uninstalled
(uninstall itself).
The code works fine until the AddIns("Periodical Table").Install=false is
called:

Private Sub Workbook_AddinInstall()
strComputer = "."
Set objWMIService = GetObject("winmgmts:" &
"{impersonationLevel=impersonate}!\\" & _
strComputer & "\root\cimv2")
Set colSettings = objWMIService.ExecQuery("Select * from
Win32_ComputerSystem")
With Workbooks("periodical Table.xla").Sheets(2)
For Each objComputer In colSettings
If LCase(objComputer.Name) < "leon1" Then
MsgBox "The program has detected that you coppied the add-in, please contact
your program provider", vbOKOnly, "Illegal copy detection"
AddIns("Periodical Table").Install=false
Else: GoTo nx
End If
Next
End With
nx:
End Sub

It does not appear any error, the msgbox works well but it nevers uninstall
the add-in.
TIA


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
uninstall an add-in filo666 Excel Programming 1 January 23rd 08 04:33 AM
Uninstall Addin Jos Vens[_2_] Excel Programming 2 April 11th 05 12:17 PM
Excel: How to uninstall a COM add-in built with VB .NET Howard Kaikow Excel Programming 2 May 11th 04 10:31 PM
Help with Uninstall Event Clinton[_2_] Excel Programming 3 April 18th 04 11:00 AM
How to uninstall XP PIAs Carol CXie Excel Programming 0 October 24th 03 11:28 PM


All times are GMT +1. The time now is 11:10 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"