I'm writing a script to record the various characteristics associated with a ream of material (supplier number, material certificates, etc). A nice way to do this I though would be to create a class object, named by the ream's serial number, with all these associated parameters.
The serial number is a string housed in an array. I'm struggling to find out whether there is some data type that can be assigned the serial number value and used to name the class object:
Dim Obj As String
Obj = Arr_IncomingCann(i, 2)
Dim Obj As New cCannister
I see why this can't work (I'm simply redimensioning "Obj"), but can someone give some advice as to whether what I'm attempting is possible?
Dictionariessee Excel VBA Dictionary – A Complete Guide. You can add a new item to the dictionary then and assign a new instance of your class to that item.