How to Use DLL in Excel

by Ann Sofer

Dynamic link library, or DLL, files hold a collection of tiny programs that can be used when you are running an executable program, or EXE, file. The DLL file allows the EXE file to communicate with the computer or a specific device such a scanner or printer to perform its functions. You can use a DLL file in Excel using a few steps. You can start by working with a Visual Basic DLL file and accessing this through Excel. Implementing the file through Visual Basic will make it easier for you to use the DLL file.

Implementing DLL File on Visual Basic

1

Create a new DLL file on Visual Basic Studio by clicking on File and selecting "New Project." Go to "Class Library" and click "OK."

2

Click on "Project" and select "ClassLibrary1 Properties" from the drop-down menu. Edit the name of the assembly as well as the root namespace to your preferred labels and open the code window.

3

Write the codes for the functions of the class and click on "Build" from the menu bar. Go to select "Build (Name of Library)" to create the DLL file.

4

Go to the "Properties" command found at the bottom of the "Project" menu. Set the description of the project to the specific string you want to see whenever you select the reference of the DLL in your Excel file.

Opening the Visual Basic DLL in Excel

1

Go to the "Tools" menu of the Excel program and select "References."

2

Find the server class of your Visual Basic DLL file and click on it.

3

Add a new module to your Excel workbook by creating a function that makes a server class instance and uses the methods of the same instance.

About the Author

Based in New York, Ann Sofer has been writing travel- and political-related articles since 2004. Her work has appeared in the “ASTA” and “Red Herring” magazines. It has also appeared in various online publications. Sofer received the Lilly M. Fuchs Literary Award in 2006. She holds a Bachelor of Science in English from Missouri State University.