Discussion Locked

Write VB code in class module

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am interested in writing VB code in a class module and compiling it as a com library.

Thank you.

5 replies

by gbworld

Both the ActiveX DLL and ActiveX EXE projects create COM components. The DLL is more common for n-tier programming, but there are times for the EXE (asynchronous programming (not waiting for an answer), program prone to crashing so it needs to run in its own space, et al).

The method of writing code for classes is the same as for forms overall. Your public sub/function is a method and accessible outside the class. Anything that is private is only accessible inside the class.

To simplify, you can use the class builder add-in. This assumes VB 6. The MSPress book Mastering Enterprise Development is a good place to start. The CD has plenty of sample files, as well as videos and exercises. If this is a bit too advanced, try Mastering Visual Basic 6 first.

As I do not have a lot of space here, write back something a bit more specific and I will give a bit more guidance.

This discussion is closed to new replies.