ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Class Modules (https://www.excelbanter.com/excel-programming/356622-class-modules.html)

MattShoreson[_70_]

Class Modules
 

Hi,

I've created a class module containing methods and properties.
Everything works fine.

However....

When I expose the methods and properties after instantiating the class
they are shown as one big list in intellisense.

i.e. clsReturnExcelADO.CompilePath

How can I change alter this to produce a more tree like behaviour?

i.e. clsReturnExcelADO.Path.compil

--
MattShoreso
-----------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...nfo&userid=347
View this thread: http://www.excelforum.com/showthread.php?threadid=52472


MattShoreson[_71_]

Class Modules
 

Is what I'm trying to do above inheritance

--
MattShoreso
-----------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...nfo&userid=347
View this thread: http://www.excelforum.com/showthread.php?threadid=52472


MattShoreson[_72_]

Class Modules
 

anyone? Tom? any ideas

--
MattShoreso
-----------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...nfo&userid=347
View this thread: http://www.excelforum.com/showthread.php?threadid=52472


Chip Pearson

Class Modules
 
Matt,

Create a new class module named CPath and insert the following
code:

Public Function Compile()
Debug.Print "Compile"
End Function

Then in your CReturnExcelADO class, put the following code:

Public Path As CPath

Private Sub Class_Initialize()
Set Path = New CPath
End Sub

Now you can call the comile method as

Dim clsReturnExcelADO As CReturnADO
Set clsReturnExcelADO = New CReturnADO
clsReturnExcelADO.Path.compile

Strucutring you code this way is a very simple object model.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com








"MattShoreson"
wrote
in message
news:MattShoreson.250lan_1142935844.5787@excelforu m-nospam.com...

Hi,

I've created a class module containing methods and properties.
Everything works fine.

However....

When I expose the methods and properties after instantiating
the class,
they are shown as one big list in intellisense.

i.e. clsReturnExcelADO.CompilePath

How can I change alter this to produce a more tree like
behaviour?

i.e. clsReturnExcelADO.Path.compile


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile:
http://www.excelforum.com/member.php...fo&userid=3472
View this thread:
http://www.excelforum.com/showthread...hreadid=524723




MattShoreson[_73_]

Class Modules
 

Thanks Chip.

Do you know of any resource/book which explains this in more detail
specifically make methods and properties accessible to parent classe
etc.

thx matt

--
MattShoreso
-----------------------------------------------------------------------
MattShoreson's Profile: http://www.excelforum.com/member.php...nfo&userid=347
View this thread: http://www.excelforum.com/showthread.php?threadid=52472


John[_88_]

Class Modules
 
Matt,

Take a look at Chip's "Class Module" page on his site:

http://www.cpearson.com/excel/ClassModules.htm

Best regards

John

"MattShoreson"
wrote in message
news:MattShoreson.2510sz_1142955902.4127@excelforu m-nospam.com...

Thanks Chip.

Do you know of any resource/book which explains this in more detail,
specifically make methods and properties accessible to parent classes
etc.

thx matt.


--
MattShoreson
------------------------------------------------------------------------
MattShoreson's Profile:
http://www.excelforum.com/member.php...fo&userid=3472
View this thread: http://www.excelforum.com/showthread...hreadid=524723





All times are GMT +1. The time now is 08:54 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com