Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Basic question - modules and class modules - what's the difference?
I just successfully implemented Jon Peltier's highlighting lines on a chart
modified and improved by Andy Pope. I notice that their instructions included the insertion of a 'class module'. I've never used one before and have no idea what it is really. Can someone let me know if it is something I should learn about? ie does it yield significanimprovements in your programming to use class modules? Thanks for your help and advice, kind regards, Mark |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Basic question - modules and class modules - what's the difference?
Search this groups archives on google groups for Class Modules and Pearson
as author. -- Regards, Tom Ogilvy "Mark Stephens" wrote in message ... I just successfully implemented Jon Peltier's highlighting lines on a chart modified and improved by Andy Pope. I notice that their instructions included the insertion of a 'class module'. I've never used one before and have no idea what it is really. Can someone let me know if it is something I should learn about? ie does it yield significanimprovements in your programming to use class modules? Thanks for your help and advice, kind regards, Mark |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Basic question - modules and class modules - what's the difference?
I just successfully implemented Jon Peltier's highlighting lines on a
chart modified and improved by Andy Pope. I notice that their instructions included the insertion of a 'class module'. I've never used one before and have no idea what it is really. Can someone let me know if it is something I should learn about? ie does it yield significanimprovements in your programming to use class modules? Class modules are used to create custom objects. Excel provides all the objects most people need, so rarely will you need to create you own class modules. Whatever you're doing with that chart must require custom events/properties that have been encapsulated in the inserted class module. The modules behind worksheets and user forms (and charts, etc) are built-in class modules that give you access to the events/properties of those objects. |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Basic question - modules and class modules - what's the difference?
"deko" wrote in message m... Excel provides all the objects most people need, so rarely will you need to create you own class modules. That's not true Deko. Excel provides most of the Excel objects, methods and properties that we need (not all!), but they provide not business function objects, so we need to create those. Class modules are ideal for that. |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Basic question - modules and class modules - what's the difference?
Excel provides all the
objects most people need, so rarely will you need to create you own class modules. That's not true Deko. Excel provides most of the Excel objects, methods and properties that we need (not all!), but they provide not business function objects, so we need to create those. Class modules are ideal for that. Perhaps I should have said "I've never had to create my own class modules." Out of curiosity, can you give me an example of the types of things class modules are typically used for? What kinds of problems can they solve? Perhaps I'll find somewhere to use one. |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Basic question - modules and class modules - what's the difference?
Personally, I'd stick with deko's analysis, since he said "most people".
I'd guess that the fraction of users of XL that have ever used a non-standard object is less than 1%, and the fraction who've actually created a "business function object" infinitesimally smaller. The overwhelming majority of workbooks in the wild don't even contain a *formula*! In article , "Bob Phillips" wrote: Excel provides all the objects most people need, so rarely will you need to create you own class modules. That's not true Deko. Excel provides most of the Excel objects, methods and properties that we need (not all!), but they provide not business function objects, so we need to create those. Class modules are ideal for that. |
#7
Posted to microsoft.public.excel.programming
|
|||
|
|||
Basic question - modules and class modules - what's the difference?
"deko" wrote in message m... Perhaps I should have said "I've never had to create my own class modules." Out of curiosity, can you give me an example of the types of things class modules are typically used for? What kinds of problems can they solve? Perhaps I'll find somewhere to use one. In the context of the point I was making, I am taking about business objects, such as Organisation, locations, employees, etc., or something along the lines of the purpose of the company, such as products, customers, etc. You may notice that most (all) of these suggest a plural, and the concept of a collection class is one of the most useful IMO. As an example, I created an appointment for my wife a while back, that had a class for the consultants, a class for the patients, and another appointments class (probably a few more in there besides, but I don't remember). One of the advantages of the class, over and above the stated advantages such as encapsulation, was that I could create a simple test harness for each class and prove it independently. Assuming my design worked, plugging it all together at the end was a doddle. Regards Bob |
#8
Posted to microsoft.public.excel.programming
|
|||
|
|||
Basic question - modules and class modules - what's the difference?
<The overwhelming majority of workbooks in the wild don't even contain a
*formula*! LOL-True! In the company I used to work for, a staff share option scheme was announced. A colleague of mine issued a spreadsheet with which you could calculate your possible profits under varying circumstances. There appeared to be no formula at all; it was just a template that could have been a paper one as well. Turned out that the colleague who had been using Excel for years already (working in a budgeting department) wasn't aware you could automate the calculations using formulas! Spreadsheet: paper with a columns and rows layout. -- Kind Regards, Niek Otten Microsoft MVP - Excel "JE McGimpsey" wrote in message ... Personally, I'd stick with deko's analysis, since he said "most people". I'd guess that the fraction of users of XL that have ever used a non-standard object is less than 1%, and the fraction who've actually created a "business function object" infinitesimally smaller. The overwhelming majority of workbooks in the wild don't even contain a *formula*! In article , "Bob Phillips" wrote: Excel provides all the objects most people need, so rarely will you need to create you own class modules. That's not true Deko. Excel provides most of the Excel objects, methods and properties that we need (not all!), but they provide not business function objects, so we need to create those. Class modules are ideal for that. |
#9
Posted to microsoft.public.excel.programming
|
|||
|
|||
Basic question - modules and class modules - what's the difference?
Out of curiosity, can you give me an example of the types of things
class modules are typically used for? What kinds of problems can they solve? Perhaps I'll find somewhere to use one. In the context of the point I was making, I am taking about business objects, such as Organisation, locations, employees, etc., or something along the lines of the purpose of the company, such as products, customers, etc. You may notice that most (all) of these suggest a plural, and the concept of a collection class is one of the most useful IMO. As an example, I created an appointment for my wife a while back, that had a class for the consultants, a class for the patients, and another appointments class (probably a few more in there besides, but I don't remember). One of the advantages of the class, over and above the stated advantages such as encapsulation, was that I could create a simple test harness for each class and prove it independently. Assuming my design worked, plugging it all together at the end was a doddle. I can think of a recent situation where I have a collection of values used for applying calculations, formatting, etc. I was thinking of putting all that stuff in a separate worksheet and having code reference the sheet and cell to make various user-requested changes in the other worksheets. I suppose I could make that into a class and let the user select options from a menu bar rather than monkey with that separate worksheet. But can I insert a class module into a workbook via automation from Access? |
#10
Posted to microsoft.public.excel.programming
|
|||
|
|||
Basic question - modules and class modules - what's the difference?
You an create a class template and import it into your project. "deko" wrote in message m... Out of curiosity, can you give me an example of the types of things class modules are typically used for? What kinds of problems can they solve? Perhaps I'll find somewhere to use one. In the context of the point I was making, I am taking about business objects, such as Organisation, locations, employees, etc., or something along the lines of the purpose of the company, such as products, customers, etc. You may notice that most (all) of these suggest a plural, and the concept of a collection class is one of the most useful IMO. As an example, I created an appointment for my wife a while back, that had a class for the consultants, a class for the patients, and another appointments class (probably a few more in there besides, but I don't remember). One of the advantages of the class, over and above the stated advantages such as encapsulation, was that I could create a simple test harness for each class and prove it independently. Assuming my design worked, plugging it all together at the end was a doddle. I can think of a recent situation where I have a collection of values used for applying calculations, formatting, etc. I was thinking of putting all that stuff in a separate worksheet and having code reference the sheet and cell to make various user-requested changes in the other worksheets. I suppose I could make that into a class and let the user select options from a menu bar rather than monkey with that separate worksheet. But can I insert a class module into a workbook via automation from Access? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Class Modules | Excel Programming | |||
Class Modules | Excel Programming | |||
Class Modules | Excel Programming | |||
Class Modules vs Modules | Excel Programming | |||
Class Modules | Excel Programming |