In this article, we will learn how to create an Excel add-in easily. What Add-in basically does is give Excel additional functionality which is highly customizable. Excel is supposed to make things easy, and VBA tries to make them easier. But this is a hell lot of complications. You might have to create a macro that takes in an input file and performs the process on it. A very simple way of doing it would be converting your code into an Add-in.
Download Practice Workbook
Download this practice workbook to exercise while you are reading this article.
What Is an Excel Add-In?
Add-in is additional functionality of Excel. Sometimes we need to use a specific function or VBA multiple times. We need to call that function or VBA code every time. To get relief from the repeated task, we can set an add-in to perform that task.
Steps to Create Excel Add-In
To create Excel Add-in, we need to follow some steps sequentially to perform that Add-in successfully. Those are:
- Step 1: Record an Excel Add-in
- Step 2: Save the Add-in in .xlam format
- Step 3: Install the Add-in
- Last Step: Run the Add-in
We will discuss all the steps in detail in the below section.
We will create an Excel Add-in to calculate the interest of the investment like a bank or other financial organization. Have a look at the below discussion.
Step 1: Record an Excel Add-In
The first step of this process is to record a macro to create an Excel Add-in.
- First, open a blank Excel workbook.
- Go to the bottom section that contains the sheet name.
- Press the right button of the mouse.
- Choose the View Code option from the Context Menu.
- We enter the VBA window.
- Select Module from the Insert tab.
- Now, the VBA module window appears, and we put the following VBA code.
Function bank_int(principle As Double, rate As Double, timeperiod As Integer) bank_int = (principle * (1 + rate) ^ timeperiod) - principle End Function
This VBA defines the operation performed by the Add-in.
Step 2: Save the Add-In in XLAM Format
We already added a VBA code in the Excel file. Usually, we save a VBA code in .xlsm format. But, here we will save this in .xlam format as it is an Add-in.
- Go to File >> Save As.
- Choose Excel Add-in (*.xlam) format and then click on the Save options.
- Go to the File Explorer.
We can see the file is saved in Add-in format.
Step 3: Install the Add-In
Our Excel Add-in file is ready. Now, we will install the newly created Add-in file to another Excel file.
- First, we enter the working Excel file.
- Go to the Developer tab and click on the Excel Add-ins section.
- The Add-ins window appears. Click on the Browse option.
- Now, choose the Add-in file from File Explorer.
- Select the file, and press the OK button.
- The Add-ins window again appears.
We can see the new add-in has been added here.
Step 4: Run the Add-In
Now, we will use the newly created add-in.
- This Add-in will be used to calculate the amount of interest.
- We collect all data in the Excel workbook, where we added the Add-in.
- Now, go to Cell C8. Then, apply the following formula.
- After that, press the Enter button.
We get the result. Now, we will able to use this add-in to any Excel file of that computer.
In this article, we described the steps of how to create an excel add-in. We also showed how to install and use that created add-in. I hope this will satisfy your needs. Please have a look at our website ExcelDemy and give your suggestions in the comment box.