In Visual Basic 6.0 and VBA, you had to instantiate an object that you wanted to work with. For example, if you used a Collection to store other objects, you had to create it first by using the following code:
Dim collection As Collection Set collection = New Collection collection.Add 5
It’s clear that simply using the following line by itself would not have worked:
Collection.Add 10 Collection.Add 15 Collection.Add 20
But that’s exactly how Visual Basic 6.0 seems to have treated forms: both the class name and instance could be identical. This version, which instantiates a Form1 instance works:
Dim f As Form1 f.Show
But you could also just use the class Form1 as instance variable directly:
Of course, this ...