Using DLLs from Visual Basic

Using DLL functions from Visual Basic Applications Edition in Microsoft Excel is very similar to using DLL functions from Visual Basic. Chapter 24 of the Microsoft Visual Basic Programmer's Guide for version 3.0 of Visual Basic provides detailed guidelines and examples for calling DLL functions from Visual Basic. This chapter provides more specific information about using DLL functions from Visual Basic in Microsoft Excel.

The examples in this chapter were prepared and tested with Microsoft Visual C++ version 4.2b and run on Microsoft Windows 95 and Windows NT Workstation 4.0. Visual C++ version 4.2b includes the OLE 2 header files and libraries required to create DLLs using variants, strings, objects, and arrays as described in this chapter.

You can use another C compiler and linker if they are capable of creating DLLs. In this case, you must also have the Microsoft Win32 SDK to create DLLs using variants, strings, objects, or arrays.

In addition to the Help provided with Visual C++ and the Win32 SDK, Chapter 6 in Volume 2 of the OLE 2 Programmer's Reference provides valuable information about the functions used in the examples in this chapter.