Hello... do any of you experts know if there's a way I can verify that a custom add-in is active?
My company uses an add-in to allow end users to construct several types of API calls. My program depends on that add-in to be installed. I'd like to try to detect the add-in and halt the program if it's not there.
Thanks for any help!
Last edited by JP Romano; 06-03-2009 at 04:11 PM. Reason: Resolved
Now available : Ultimate Add-In 2007
Integrates directly into the Office Excel Ribbon
Download Ultimate Add-In v1.52 from www.dom-and-lis.co.uk
90+ Utilities, 200+ Sub utilities last updated 25th April 2008
Free!!
This pair of functions may help:
Example usage:Code:Function AddinIsInstalled(ByVal sName As String) As Boolean ' Returns returns True if add-in is installed Dim oAddIn As AddIn sName = UCase(sName) For Each oAddIn In Application.AddIns If UCase(oAddIn.Name) = sName Then AddinIsInstalled = True Exit For End If Next oAddIn End Function Function InstallAddIn(ByVal sPath As String, sName As String) As Boolean ' Installs an add-in, returns True if successful. Dim oAddIn As AddIn If Right(sPath, 1) <> "\" Then sPath = sPath & "\" If AddinIsInstalled(sName) Then Application.AddIns(sName).Installed = False On Error Resume Next Set oAddIn = Application.AddIns.Add(sPath & sName) oAddIn.Installed = True InstallAddIn = Err.Number = 0 Err.Clear End Function
Code:InstallAddIn "C:\myPath", "myAddIn.xla"
Last edited by shg; 06-01-2009 at 04:06 PM.
Microsoft MVP - Excel
Entia non sunt multiplicanda sine necessitate
These are great suggestions, and I'll have at them this afternoon. Many MANY thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks