In your public subs,functions...within your class, place your types as Objects and then deal with them. you could also rewrite your class to include other helper classes that can prevnt this sort of thing in future. if you try to pass Private sub Combobox1(..) into your Public Function ReturnItem(byval cbItem as Combobox) there is your error. Private object -combobox1 into Public function . Your DLL doesn't know what the heck type Combobox is because it only knows what you tell it . So you may also have success making Combobox1 - in the form - a Public Sub Combobox1 (....), then pass it to your DLL, but what if you forget about doing this to all those objects on form in future projects that use your DLL? So the work araound for you, right now would be probably something similar to: Public Function MyFunctionInMyDLL(Byref f as Object) Dim frm As Form Set frm = f ' do something 'return something to form being referenced End Function
hope that helps. learn how to refactor
|