View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_463_] Leith Ross[_463_] is offline
external usenet poster
 
Posts: 1
Default Module vs Class Module


Hello DCSwearingen,

Class modules are used to create custom objects. These objects don't
have to be visible like a Window or control. They can be objects like a
Collection. The objects have Properties that are defined by the Let,
Get, and Set statements in VBA. Methods are created using Subs and
Functions. These can be either Public (Global in scope) or Private
(Local in scope - for the Class' use only). Class modules are sometimes
referred to as "In-process Servers".

You can create one whenever discover you need an object to perform
certain functions that don't already exist. To use the Class object,
you use the Dim statement. For example: Dim myObj As New MyClass

The first reference to the object in your code will create an instance
of the object. The object's lifetime depends on where it delcared, just
like other objects and variables. This is just an overview and not a
thorough explanation , but I hope it helps you to better understand
what a Class module is.

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=501243