Is it possible to set an object as a class that isn't its own class?
For instance, if I have a class of Class_Fruit
and a class of Class_Apple
, is there any way to do:
Dim appleClass as Class_Fruit
Set appleClass = New Class_Apple
Like what you can do in other languages like Java
I suspect it's not possible, because VBA is just not built to work like that and it doesn't have inheritance, but I wanted to ask to make sure.
I've had a look around but not been able to find a definitive answer, so I figured I should ask before I waste any more time trying to get it to work. I'm RELATIVELY new to Class objects in VBA, and pretty much all I can find about them is how to build them, not the further levels of functionality that they might have.
I have a workaround I can use if this isn't possible, but doing this would be much easier if there is any way to do it at all.