Type Libraries

You can create a type library for your DLL. The type library can contain constant and function declarations and other information about the DLL. A type library can be compiled into your DLL as a resource. Once you have created a type library, you can use the References command on the Tools menu in Microsoft Excel to load the type library. Once loaded, the constant and function declarations are available in Visual Basic without Declare statements.

Visual Basic in Microsoft Excel does not support user-defined data-structure declarations in type libraries. (User-defined data structures are those declared with the Visual Basic "Type" statement or the C/C++ "struct" statement.) To use the structures in your Visual Basic code, you will have to add their declarations to the module.

For more information about creating type libraries, see Chapter 7 in Volume 2 of the OLE 2 Programmer's Reference.