PC Review


Reply
Thread Tools Rate Thread

Disable Add-Ins using VBA Excel 2003

 
 
powlaz
Guest
Posts: n/a
 
      28th Dec 2009
I am interested in knowing if it is possible to disable an add-in in the
workbook open event using VBA. I have just identified a problem with the
Dymo LabelWriter add-in that is causing one of my workbooks to error out.

Since we don't need the Dymo printer (or any printer) for this workbook I
would like to disable the add-in. Please tell me how I can do this. I speak
pretty poor VB so an example is much appreciated.

Thanks,

MJ
 
Reply With Quote
 
 
 
 
Mike H
Guest
Posts: n/a
 
      28th Dec 2009
Hi,

This would uninstall the Analysis toolpak so substiitute with you addin name

Sub UnInstall_Addins()
Dim XLAddin As AddIn
For Each XLAddin In Application.AddIns
If XLAddin.Name = "ANALYS32.XLL" = True Then
XLAddin.Installed = False
End If
Next XLAddin
End Sub

Mike

"powlaz" wrote:

> I am interested in knowing if it is possible to disable an add-in in the
> workbook open event using VBA. I have just identified a problem with the
> Dymo LabelWriter add-in that is causing one of my workbooks to error out.
>
> Since we don't need the Dymo printer (or any printer) for this workbook I
> would like to disable the add-in. Please tell me how I can do this. I speak
> pretty poor VB so an example is much appreciated.
>
> Thanks,
>
> MJ

 
Reply With Quote
 
Gary Keramidas
Guest
Posts: n/a
 
      28th Dec 2009
you could put this in the workbook open event:

AddIns("addInName").Installed = False

then before close event:

AddIns("addInName").Installed = true

--


Gary Keramidas
Excel 2003


"powlaz" <(E-Mail Removed)> wrote in message
news:3FF84D48-56A6-44D0-A82B-(E-Mail Removed)...
>I am interested in knowing if it is possible to disable an add-in in the
> workbook open event using VBA. I have just identified a problem with the
> Dymo LabelWriter add-in that is causing one of my workbooks to error out.
>
> Since we don't need the Dymo printer (or any printer) for this workbook I
> would like to disable the add-in. Please tell me how I can do this. I speak
> pretty poor VB so an example is much appreciated.
>
> Thanks,
>
> MJ


 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      28th Dec 2009
Maybe you could just close that addin when you open your workbook and reopen the
addin when you close your workbook???

Option Explicit
Const AddinPath As String = "c:\excel\" '<- include that trailing backslash!
Const AddinName As String = "DemoAddinNameHere.xla"
Private Sub Workbook_BeforeClose(Cancel As Boolean)

Dim TestWkbk As Workbook
Dim Resp As Long

Set TestWkbk = Nothing
On Error Resume Next
Set TestWkbk = Workbooks(AddinName)
On Error GoTo 0

If TestWkbk Is Nothing Then
Resp = MsgBox(Prompt:="Wanna open " & AddinName & "?", Buttons:=vbYesNo)
If Resp = vbYes Then
'open it
Workbooks.Open Filename:=(AddinPath & AddinName)
End If
End If

End Sub
Private Sub Workbook_Open()

On Error Resume Next
Workbooks(AddinName).Close savechanges:=False
On Error GoTo 0

End Sub

=========
If you were really industrious, you could open/close the addin when you
deactivate/activate your workbook.



powlaz wrote:
>
> I am interested in knowing if it is possible to disable an add-in in the
> workbook open event using VBA. I have just identified a problem with the
> Dymo LabelWriter add-in that is causing one of my workbooks to error out.
>
> Since we don't need the Dymo printer (or any printer) for this workbook I
> would like to disable the add-in. Please tell me how I can do this. I speak
> pretty poor VB so an example is much appreciated.
>
> Thanks,
>
> MJ


--

Dave Peterson
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel 2003 format menu disable it Microsoft Excel Setup 1 29th Oct 2007 02:15 PM
Excel 2003 in MSIE 6.0 window - disable - please help WMB Windows XP Internet Explorer 1 29th Jul 2005 10:33 AM
Disable format painter in excel 2003 =?Utf-8?B?dGVuY2hzYW1h?= Microsoft Excel New Users 1 8th Feb 2005 12:53 AM
How can I disable format painter in excel 2003? =?Utf-8?B?dGVuY2hzYW1h?= Microsoft Access Getting Started 1 7th Feb 2005 09:14 PM
Excel 2003; Open & Disable macros Jon Microsoft Excel Misc 1 24th May 2004 02:03 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:56 PM.