I have run into a problem where I need to use an old API created in VB6 which requires a vba.collection to be used when referencing the API for something.
I can't do this in my .net project as it fails when trying to convert visual.basic.collection to vba.collection.
I have found a workaround but cannot create the vb6 dll as I do not have vb6 and I cannot get hold of a copy.
Below are the steps I need to carry out in VB6, could anyone kindly help me to create this dll so I can complete my project?
Many Thanks!
Create a Visual Basic 6.0 DLL that returns the collection
Create a Visual Basic 6.0 Microsoft ActiveX DLL project. By default, the Class1 class is created.
Rename the project CollectionFactory, and then rename the class clsVBACollection.
Add the following code to the clsVBACollection class.
' This function creates a new object of the VBA collection.
Public Function CreateVBACollection() As Collection
' Define a variable of type Collection.
Dim col As Collection
' Create a Collection object.
Set col = New Collection
' Return the Collection object.
Set CreateVBACollection = col
End Function
On the File menu, click Make CollectionFactory.dll.