Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Class module
Hi NG
Just out of curiosity. What is the difference between a module and a class module. Regards Mark |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Class module
A class module is used to define an object, and will have properties and
methods associated with that object defined in there (the attributes of the object, and the actions that can be performed on/'by it). Using the familiar example, you might have an employee class, with name, age, sex, grade properties, and maybe a method to calculate bonus, wage increase, etc. The properties can be read and/or write. A module is normally where you would store the common or shared procedures, ones that may be used even by the class, but do not define a (that) object themselves. You use a class like so Dim myEmp as clsEmployee Set myEmp = New clsEmployee with myEmp .Forename = "Bill" .Surname = "Wallis" .DOB = "12 Jun 1976" .Sex = "M" .AddLine1 = "37 Acacia Avenue" 'etc End With You now have an instance of an employee with many details that you can access directly. YOu could then put that employee into another class, a collection class of employees ... but too much too soon perhaps. By the way, userforms and worksheet code modules are also special calls modules, defining the form or the worksheet they are associated with. -- HTH Bob Phillips ... looking out across Poole Harbour to the Purbecks (remove nothere from the email address if mailing direct) "Mark" wrote in message ... Hi NG Just out of curiosity. What is the difference between a module and a class module. Regards Mark |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Class module
Search google on the subject:
http://www.google.com/groups?as_q=cl...e=off&ie=UTF-8 &oe=UTF-8&as_ugroup=*excel*&as_uauthors=pearson&lr=&num=20 &hl=en -- Regards, Tushar Mehta, MS MVP -- Excel www.tushar-mehta.com Excel, PowerPoint, and VBA add-ins, tutorials Custom MS Office productivity solutions In article , says... Hi NG Just out of curiosity. What is the difference between a module and a class module. Regards Mark |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Creating UDF by Class Module (Leo)? | Excel Discussion (Misc queries) | |||
CLASS MODULE & SIMPLE MODULE | Excel Discussion (Misc queries) | |||
Class Module Scope | Excel Programming | |||
Class module | Excel Programming | |||
Variable from a sheet module in a class module in XL XP | Excel Programming |