To create the dll:
1. Start a new project in VB, and select ActiveX DLL for project type.
2. Add a class.
3. Set the classes instancing to 5 - Multiuse or 6 - Globalmultiuse.
4. Give the class a public method.
5. Compile the project.
To instantiate the dll -
with CreateObject: -
Dim MyObject As Object
-
-
Set MyObject = CreateObject ("MyDllProject.MyDllClass")
-
with project references:
Register the Dll (though, you dont need to if you compiled it on the same machine):
1. Add a reference the dll (project/references).
(note: if you do not see your class in the list, click Browse to select the dll).
-
Dim MyObject As MyDllProject.MyDllClass
-
Then, you can work with the methods defined publicly for the class:
Hope it helps