Excel VBA Classes practical real life examples

Murray Brown
Murray Brown used Ask the Experts™
on
Hi

I am in the early stages of unfderstanding classes and need a few practical examples. Please could someone explain one or two simple examples where they have had to use classes and why normal modules couldn't be used.

Thanks
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
hi,

Two times that I have used classes have been for stopwatch code & for creating separate I-series sessions to do different tasks. I could run different "watches" concurrently with the stopwatch code & I didn't need to be too accurate so I wasn't concerned about the overhead impacting the timing.

I'm not very experienced at using classes but I found Chip's page quite useful as a starting point: http://www.cpearson.com/excel/classes.aspx


Here are some other questions & links which discuss classes or have informative links:
http://www.informit.com/articles/article.aspx?p=1346864
http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_26921977.html#35259803

http://www.dailydoseofexcel.com/archives/2004/09/28/classes-creating-custom-objects/

http://www.experts-exchange.com/Software/Office_Productivity/Office_Suites/MS_Office/Excel/Q_24705467.html

http://www.dailydoseofexcel.com/archives/2008/05/08/using-a-class-property-to-do-more-than-just-assign-or-query-a-value/

hth
Rob
Most Valuable Expert 2011
Top Expert 2011
Commented:
Other than event handling, there are few situations (if any) where normal modules couldn't be used in place of classes. Kind of misses the point of classes though.
Murray BrownASP.net/VBA/VSTO Developer

Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial