PC Review


Reply
Thread Tools Rate Thread

What is the benifit to programming w/ Class Modules

 
 
Office_Novice
Guest
Posts: n/a
 
      1st Oct 2008
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 With Quote
 
 
 
 
Nobody
Guest
Posts: n/a
 
      1st Oct 2008
"Office_Novice" <(E-Mail Removed)> wrote in message
news:71538C44-844D-4DEC-8EFA-(E-Mail Removed)...
> 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/library/aa141681(office.10).aspx

http://puremis.net/excel/code/086.shtml

http://exceltip.com/st/Class_modules...Excel/510.html


 
Reply With Quote
 
Chip Pearson
Guest
Posts: n/a
 
      1st Oct 2008
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
<(E-Mail Removed)> 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 With Quote
 
Office_Novice
Guest
Posts: n/a
 
      2nd Oct 2008
Thanks for the links they have been bookmarked.

"Nobody" wrote:

> "Office_Novice" <(E-Mail Removed)> wrote in message
> news:71538C44-844D-4DEC-8EFA-(E-Mail Removed)...
> > 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/library/aa141681(office.10).aspx
>
> http://puremis.net/excel/code/086.shtml
>
> http://exceltip.com/st/Class_modules...Excel/510.html
>
>
>

 
Reply With Quote
 
Office_Novice
Guest
Posts: n/a
 
      2nd Oct 2008
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
> <(E-Mail Removed)> 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 With Quote
 
Bob Phillips
Guest
Posts: n/a
 
      2nd Oct 2008
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" <(E-Mail Removed)> wrote in message
news757D803-8A88-4778-8CD8-(E-Mail Removed)...
> 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
>> <(E-Mail Removed)> 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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
class modules versus modules Matt S Microsoft Excel Programming 1 12th Apr 2010 09:31 PM
Public Variables, Class Modules and Standard Modules Excel Monkey Microsoft Excel Programming 2 30th Apr 2009 03:18 PM
Class modules: parametrize class object fields Jean-Pierre Bidon Microsoft Excel Programming 11 31st Aug 2006 02:49 PM
Basic question - modules and class modules - what's the difference? Mark Stephens Microsoft Excel Programming 9 8th May 2005 11:48 AM
modules vs class modules =?Utf-8?B?cm9kbmV5?= Microsoft Access Getting Started 1 21st Mar 2004 02:47 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:49 AM.