PDA

View Full Version : I want to extend a Collection Class (or any other built in class)



nitt1995
08-08-2006, 12:54 PM
I am a relatively new OOP programmer that learned with Java. I have been working on some VBA projects and am having some difficulty getting certain functionality.

I want to create a custom Collection Class that can only hold a specific Object Type.

My literature review tells me that I should be able to write (on the top of a new class module):

Implements Collections.

This should allow me to then define all of the applicable methods for collections like:

Private Function Collections_Add;
Private Function Collections_Remove:
etc...

By creating my own public classes that link to each of the above private classes, I should be able to effectively extend the functionality of the original built-in object and allow VBA to recognize my new class as a type of the extended class.

I can do this for private classes modules that I have created, but this process is not working for collections (or any other built-in functions that I have tried).

Any suggestions would be appreciated.