#1
|
|||
|
|||
Removing add in programatically
Hi,
I need to remove an add in (global template) programatically. I uncheck and remove the add in from the list as follows: Code:
Application.AddIns(sAddInFileName).Installed = False Application.AddIns(sAddInFileName).Delete Code:
Kill sAddInFilenameAndPath Hence, I assume the template file is still open but when trying to use Code:
Documents(sAddInFilenameOnly).Close Thanks for your help. |
#2
|
||||
|
||||
Can you delete the addin manually after running:
Code:
Application.AddIns(sAddInFileName).Installed = False Application.AddIns(sAddInFileName).Delete
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thanks. That got me a step further. The template is indeed open.
For testing purposes I commented out the disabling and removal from the global template list. Then I inserted the following code: Code:
MsgBox Templates.Count MsgBox Templates.Item(sOldAddInFile).FullName For Each oTemp In Application.Templates sMsg = oTemp.FullName & vbNewLine Next oTemp MsgBox sMsg Then, however, when I iterate through the templates collection, the msgbox only lists the Normal.dot as entry and not my add in file. Weird! Any clue why or how that could be? Yet, even if I solve that issue, unlike the documents collection, the templates collection does not have a close method. So, the question would still be, how can I close the add-in file? Unfortunately, the add-in is not part of the documents collection. I checked! Help is much appreciated. |
#4
|
||||
|
||||
This works for me:
Code:
Sub KillMyAddin(sAddInFileName As String) Dim strFile As String, oAddIn As AddIn For Each oAddIn In Application.AddIns With oAddIn If .Name = sAddInFileName Then strFile = .Path & "\" & sAddInFileName .Installed = False .Delete End If Kill strFile End With Next End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
Though I don't see any major differences, your scripts worked.
Thank you. |
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Programatically hide slides during presentation | ky1488 | PowerPoint | 4 | 09-11-2013 08:21 AM |
How do I send an email programatically? | macroscope | Outlook | 7 | 02-01-2013 02:27 PM |
Programatically Managing Word Document Structure | mlbliss | Word VBA | 3 | 11-07-2012 07:42 PM |
Apply font color programatically using VBA Word | divakarganta | Word VBA | 3 | 08-08-2012 08:05 PM |
Programatically open Outlook folder (set focus) using RDO? | NicMic | Outlook | 0 | 01-10-2008 03:27 PM |