+ Reply to Thread
Results 1 to 6 of 6

Class Modules

  1. #1
    Forum Contributor
    Join Date
    12-04-2003
    Posts
    360

    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.compile

  2. #2
    Forum Contributor
    Join Date
    12-04-2003
    Posts
    360
    Is what I'm trying to do above inheritance?

  3. #3
    Forum Contributor
    Join Date
    12-04-2003
    Posts
    360
    anyone? Tom? any ideas?

  4. #4
    Chip Pearson
    Guest

    Re: 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"
    <[email protected]> wrote
    in message
    news:[email protected]...
    >
    > 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
    >




  5. #5
    Forum Contributor
    Join Date
    12-04-2003
    Posts
    360
    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.

  6. #6
    John
    Guest

    Re: 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" <[email protected]>
    wrote in message
    news:[email protected]...
    >
    > 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
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1