Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Greetings,
I am a novice trying to fully or at least partially understand the benifits to Class Modules. After looking through a ton of stuff on the internet i find myself even more confused. Seems like an awful lot of typing for little result. What am i missing? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
"Office_Novice" wrote in message
... Greetings, I am a novice trying to fully or at least partially understand the benifits to Class Modules. After looking through a ton of stuff on the internet i find myself even more confused. Seems like an awful lot of typing for little result. What am i missing? Some links for you: http://msdn.microsoft.com/en-us/libr...ffice.10).aspx http://puremis.net/excel/code/086.shtml http://exceltip.com/st/Class_modules...Excel/510.html |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the links they have been bookmarked.
"Nobody" wrote: "Office_Novice" wrote in message ... Greetings, I am a novice trying to fully or at least partially understand the benifits to Class Modules. After looking through a ton of stuff on the internet i find myself even more confused. Seems like an awful lot of typing for little result. What am i missing? Some links for you: http://msdn.microsoft.com/en-us/libr...ffice.10).aspx http://puremis.net/excel/code/086.shtml http://exceltip.com/st/Class_modules...Excel/510.html |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have an introduction to classes on my web site at
http://www.cpearson.com/excel/Classes.aspx. A class module is used to present an abstraction of anything you need to work with in your program. For example, for a office productivity application, you need to deal with people. You would create a class named CPerson, give it properties (which are like adjectives -- they describe attributes such as Name, Address, Salary) and give it methods (which are like verbs -- they carry out actions, like PrintPaycheck). Once you have a class, you create instances of the class called object (Dim Pawn As CPerson, Dim Boss As CPerson) and you can pass those objects around within an application, and the code that uses them need not know the internals of how a class is implemented. The code can simply examine the appropriate properties or carry out the various methods while being peacefully oblivious to all else that makes up the class. If you programmed with structures (also called structs or records), a class is like a structure except that it executes code in addition to simply storing data value in an organized way. Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com The San Diego Project Group, LLC (email is on the web site) USA Central Daylight Time (-5:00 GMT) On Wed, 1 Oct 2008 09:49:01 -0700, Office_Novice wrote: Greetings, I am a novice trying to fully or at least partially understand the benifits to Class Modules. After looking through a ton of stuff on the internet i find myself even more confused. Seems like an awful lot of typing for little result. What am i missing? |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks for the reply Chip,
I spend an awful lot of time on your site and have seen the introduction to classes. So using your example would I have to create a new class for each person, or just one for everybody? "Chip Pearson" wrote: I have an introduction to classes on my web site at http://www.cpearson.com/excel/Classes.aspx. A class module is used to present an abstraction of anything you need to work with in your program. For example, for a office productivity application, you need to deal with people. You would create a class named CPerson, give it properties (which are like adjectives -- they describe attributes such as Name, Address, Salary) and give it methods (which are like verbs -- they carry out actions, like PrintPaycheck). Once you have a class, you create instances of the class called object (Dim Pawn As CPerson, Dim Boss As CPerson) and you can pass those objects around within an application, and the code that uses them need not know the internals of how a class is implemented. The code can simply examine the appropriate properties or carry out the various methods while being peacefully oblivious to all else that makes up the class. If you programmed with structures (also called structs or records), a class is like a structure except that it executes code in addition to simply storing data value in an organized way. Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com The San Diego Project Group, LLC (email is on the web site) USA Central Daylight Time (-5:00 GMT) On Wed, 1 Oct 2008 09:49:01 -0700, Office_Novice wrote: Greetings, I am a novice trying to fully or at least partially understand the benifits to Class Modules. After looking through a ton of stuff on the internet i find myself even more confused. Seems like an awful lot of typing for little result. What am i missing? |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You would create one class instance for every person (Set Person = New
cPerson). It would be useful to group the people into a collection class, which gives you the ability to iterates through every member (person) of that class. -- __________________________________ HTH Bob "Office_Novice" wrote in message ... Thanks for the reply Chip, I spend an awful lot of time on your site and have seen the introduction to classes. So using your example would I have to create a new class for each person, or just one for everybody? "Chip Pearson" wrote: I have an introduction to classes on my web site at http://www.cpearson.com/excel/Classes.aspx. A class module is used to present an abstraction of anything you need to work with in your program. For example, for a office productivity application, you need to deal with people. You would create a class named CPerson, give it properties (which are like adjectives -- they describe attributes such as Name, Address, Salary) and give it methods (which are like verbs -- they carry out actions, like PrintPaycheck). Once you have a class, you create instances of the class called object (Dim Pawn As CPerson, Dim Boss As CPerson) and you can pass those objects around within an application, and the code that uses them need not know the internals of how a class is implemented. The code can simply examine the appropriate properties or carry out the various methods while being peacefully oblivious to all else that makes up the class. If you programmed with structures (also called structs or records), a class is like a structure except that it executes code in addition to simply storing data value in an organized way. Cordially, Chip Pearson Microsoft MVP Excel Product Group Pearson Software Consulting, LLC www.cpearson.com The San Diego Project Group, LLC (email is on the web site) USA Central Daylight Time (-5:00 GMT) On Wed, 1 Oct 2008 09:49:01 -0700, Office_Novice wrote: Greetings, I am a novice trying to fully or at least partially understand the benifits to Class Modules. After looking through a ton of stuff on the internet i find myself even more confused. Seems like an awful lot of typing for little result. What am i missing? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Class programming - how to return chartobject from a class? | Excel Programming | |||
Class modules: parametrize class object fields | Excel Programming | |||
Basic question - modules and class modules - what's the difference? | Excel Programming | |||
Class modules | Excel Programming | |||
Class Modules vs Modules | Excel Programming |