ERLANDSEN DATA CONSULTING Excel & VBA Tips   Informasjon på norsk / Information in Norwegian

These pages are no longer updated and are only available for archive purposes.

Click here to visit the pages with updated information.

What is an addin?

An addin is a workbook with custom commands and functions that can be used with Excel. Addin's are used to distribute macros, userdefined functions or custom solutions to other users. If the addin contains VBA code that refers to the workbook running the code you have to use the object ThisWorkbook instead of ActiveWorkbook. An addin will never be the active workbook.

When you save a workbook as an addin, the content is "compiled" and protected so that the source code is (usually) not visible and editable by other people. You can find tools on the Internet that can "crack" this protection from addin's made for Excel 5/95 and Excel97, but ordinary users will usually not be able to see or edit the contents of an addin.

When you create an addin in Excel5/95 you have to save your original workbook if you want to be able to edit the contents of your addin. Excel5/95 can not open and edit the addin, you will have to edit the original workbook and create a new addin every time you need to make a change to the addin.
Excel97 can open and edit addins, so it's not necessary to keep a copy of the original workbook you created the addin from. It's also possible to password protect the contents of the VBA project in the workbook so that the source code is (usually) not visible and editable by other people.

Addin's can be installed by opening the file as you open an ordinary workbook. You can also install the addin by saving it to the Library folder and installing it from the Addin Manager with the menuchoice Tools, Addins.... When you install an addin the custom functions are available to the user, and any userdefined menus in the addin will also be added to the existing menus in Excel. 

Addin's installed by the Addin Manager can be uninstalled by removing the checkmark in the list of installed addin's in the Addin Manager.

Addin's can also be installed and uninstalled by using VBA-code.

 

Document last updated 2001-04-07 12:46:25      Printerfriendly version

User comments:
Ole P. from Norway wrote (2006-11-23 23:02:33 CET):
Re: How do I use an addin
If the addin contains user defined worksheet functions, you can use them just like the built-in functions in Excel, assuming that you have opened or installed your addin.
If you want to use normal procedures, your addin must also create the user interface to these procedures, e.g. by creating a menu or a toolbar using the event macros Workbook_AddinInstall and Workbook_AddinUninstall in the ThisWorkbook module.
falken from Sweden wrote (2006-11-23 19:25:48 CET):
How do I use an addin
I have created an addin and it appear on the VBE window but I can't use it. How do I do to call the functions I have in my addin?
Ole P. from Norway wrote (2005-03-08 00:40:55 CET):
How do I install an addin using VBA?
You can use something like this:

Sub InstallAddIn()
Dim ai As AddIn
Set ai = Application.AddIns("Solver Add-in")
If Not ai.Installed Then
ai.Installed = True
End If
Set ai = Nothing
End Sub


The ADO library is not available as an add-in.
You will usually have to add a reference to the ADO library, either manually when you create the workbook, or by code.
You can set a reference manually from within the VBE by selecting the menu Tools, References and selecting Microsoft ActiveX Data Objects x.x Object Library.

If you want to use code, take a look at the built in help regarding:
ThisWorkbook.VBProject.References.AddFromGuid
ThisWorkbook.VBProject.References.AddFromFile
Note that you can't use code to fix a broken reference.

You can also use late binding to avoid setting references.
Gary from England wrote (2005-03-07 16:45:47 CET):
How do I install an addin using VBA?
Can I also check it's status?
For example, the addin required for ADO functions.

 

Erlandsen Data Consulting     http://www.erlandsendata.no/   
Excel & VBA Tips   Copyright ©1999-2024    Ole P. Erlandsen   All rights reserved
E-mail Contact Address