I am designing a program behind excel and using VBA 6.5. I am having some problems with the built in dictionary object. I understand the basics and have found numerous examples on how to add simple data to them but I'm more concerned with custom objects.
My problem: I have an object with several constructors - X, Y, Yf, A, P, etc. Now there are many of these objects that need to be collected. I have tried using a simple Collection class for these objects but have read that Dictionaries are quicker and when dealing with as many of these objects I need the program to run as quickly as possible.
Basically, how do you add a custom object to a dictionary object
Dim testDict as Dictionary
Dim myObj as CustomObject
Dim myObj2 as CustomObject
Set testDict = New Dictionary
Set myObj = New CustomObject
Set myObj2 = New CustomObject
testDict.Add(0, myObj)
testDict.Add(1, myObj2)