Graphite2001 Posted October 2, 2003 Posted October 2, 2003 Hello All, I have a problem with a VB.net project using ActiveX user control. There is a method in my user control that takes a collection as an argument (originally in VB6). However, after i upgraded the whole project into VB.Net, everything works out perfectly except for this particular function. Now when i look at the function signature from the intellisense, i see that the argument becomes a VBA.Collection. Thus, if i passed in a regular collecton that i dim in my .NET project ( i think it's VisualBasic.Collection), it gives me an error (error 13). Is there a way to solve this problem? Thank you Anson:-\ Quote
Administrators PlausiblyDamp Posted October 2, 2003 Administrators Posted October 2, 2003 Probably not. If the control is expecting a VBA.Collection that's what you will have to provide. Would re-writing the control be a valid option? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Graphite2001 Posted October 2, 2003 Author Posted October 2, 2003 yeah, that's is a valid option. however, is it possible for me to declare a VBA.Collection instead of VisualBasic.Collection in my project? Then i pass my VBA.Collection to my control. (assuming this VBA.Collection only uses once.) I tried this, but it gives me an error 429. Anson Quote
Administrators PlausiblyDamp Posted October 2, 2003 Administrators Posted October 2, 2003 If you set a reference to the VisualBasic compatability layer you should be able to declare a VBA.Collection. What code are you using that gives the error 429? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Graphite2001 Posted October 2, 2003 Author Posted October 2, 2003 the error message i'm getting is exactly as follow: Error 429, COM object with CLSID {A4C4671C-499F-101B-BB78-00AA00383CBB} is either not valid or not registered I'm running in the following statement that gives me this message. Dim EventCollectionDAY(42) As VBA.Collection For i = 0 To 41 EventCollectionDAY(i) = New VBA.Collection 'This is where i get the error message Next i Call MyControl(i).Set_EventList(EventCollectionDAY(i)) 'MyControl is an AX Control from VB6 'Set_EventList takes VBA.Collection as an argument. Anson Quote
Graphite2001 Posted October 2, 2003 Author Posted October 2, 2003 I just double checked my project. I found that i already have the following 2 references: Microsoft.VisualBasic.Compatibility Microsoft.VisualBasic.Compatibility.Data Are those the 2 reference you were mention in the previous email? Anson Quote
Administrators PlausiblyDamp Posted October 2, 2003 Administrators Posted October 2, 2003 They were the ones I was thinking of..... Just out of interest though Dim EventCollectionDAY(42) As VBA.Collection For i = 0 To 41 EventCollectionDAY(i) = New VBA.Collection Next i will be declaring an array of 43 collections and initalizing the first 42 of them - is that what you wanted to do there? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Graphite2001 Posted October 2, 2003 Author Posted October 2, 2003 hehe, no, well, i should've declared and array of 41 since i only use 41 of them. Anson Quote
Recommended Posts